Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » GTK+
  • » 4 short questions about the use of GTK [RSS Feed]

#1 Nov. 19, 2005 01:59:43

tjas n.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

4 short questions about the use of GTK


HiI just got 4 questions for you. I would be glad if you can take your time to answer them.1. Is it possible to create a window with no frame? With that I mean
the frame with, minimize, maximize, quit buttons. If so, how?2. Is it possible to make a box appear/disappear (or change content)
with a button click? I've seen labels can be edited by this, but can
the content of a box change?3. How can I customize font styles? E.g I want a headline to be
displayed in font size: 16, and some other label should be displayed in
bold text style.4. Can I connect an event to a gtk.Image? Like when it's clicked it will execute a function? Like a button?Thanks for any input!_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#2 Nov. 19, 2005 04:14:56

Claudio P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

4 short questions about the use of GTK


> Hi
Hi

> I just got 4 questions for you. I would be glad if you can take your time to
> answer them.
Ok. I have 4 short answers.

> 1. Is it possible to create a window with no frame? With that I mean the
> frame with, minimize, maximize, quit buttons. If so, how?
Yes. How? Follow the examples!

> 2. Is it possible to make a box appear/disappear (or change content) with a
> button click? I've seen labels can be edited by this, but can the content of
> a box change?
Yes. Create a box (window or dialog) and them show, iterate and then hide.

> 3. How can I customize font styles? E.g I want a headline to be displayed in
> font size: 16, and some other label should be displayed in bold text style.
You can use RC styles, read the documentation.

> 4. Can I connect an event to a gtk.Image? Like when it's clicked it will
> execute a function? Like a button?
Yes. Put you image widget into a event box widget.

> Thanks for any input!
Your welcome and good luck!

--

's

Claudio
Um peregrino de problemas. Um pergaminho de soluções.

_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#3 Nov. 19, 2005 17:42:01

tjas n.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

4 short questions about the use of GTK


Thank you for a great reply Claudio!But there was some answerer's I did not understand completely.On 11/19/05,Claudio Polegato Junior<> wrote:1. Is it possible to create a window with no frame? With that I mean the> frame with, minimize, maximize, quit buttons. If so, how?Yes. How? Follow the examples!What example are you referring to?> 2. Is it possible to make a box appear/disappear (or change content) with a> button click? I've seen labels can be edited by this, but can the content of> a box change?Yes. Create a box (window or dialog) and them show, iterate and then hide.I am not sure you understand me correct. It's a gtk.HBox() and I want
the content of it to be changed/hided/showed with a button click._______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#4 Nov. 19, 2005 18:33:01

Gian M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

4 short questions about the use of GTK


2005/11/19, tjas ni <>:

> What example are you referring to?http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#gtk-window-set-decorated> I am not sure you understand me correct. It's a gtk.HBox() and I want the
> content of it to be changed/hided/showed with a button click.

Connect a function to the button click that will hide or show the
contents of the Box.http://developer.gnome.org/doc/API/2.0/gtk/GtkButton.html#GtkButton-clickedcheers
--
Gian Mario Tagliaretti
PyGTK GUI programminghttp://www.parafernalia.org/pygtk/_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#5 Nov. 19, 2005 23:24:37

Irv M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

4 short questions about the use of GTK


On Saturday 19 November 2005 12:00 pm, wrote:
> 1. Is it possible to create a window with no frame? With that I mean the
> frame with, minimize, maximize, quit buttons. If so, how?

use Gtk (*)

app = application("No Frame")
win = window(app.name)
win.set_decorated(false) <--
win.show_all
app.main

> 2. Is it possible to make a box appear/disappear (or change content) with a
> button click? I've seen labels can be edited by this, but can the content
> of a box change?
use Gtk (*)

app = application("Change Pix")
win = window(app.name)
win.set_default_size(400,400)

panel = vbox()
win.add(panel)

img1 = image('tweety_e0.gif')
img2 = image('qu.gif')

panel.add()

btn = toggle_button('Swap') btn.connect('clicked',@change)
panel.pack_end(btn)

win.show_all
img2.hide
app.main

sub change(x:Int)->Int # swaps images when button toggled
switch btn.get_active
case true img1.hide img2.show break
case false img2.hide img1.show break
;;
return 0;;

> 3. How can I customize font styles? E.g I want a headline to be displayed
> in font size: 16, and some other label should be displayed in bold text
> style.

use Gtk (*)

app = application("Change")
win = window(app.name)
win.set_default_size(400,400)

panel = vbox()
win.add(panel)

lbl1 = label('Label One')
lbl1.modify_font('Courier 16') # one way

lbl2 = label("<b>Bold</b> and <i>Italic</i>") # another way (pango markup)

panel.add()

win.show_all
app.main

> 4. Can I connect an event to a gtk.Image? Like when it's clicked it
> will execute a function? Like a button?

Yes. Put 'em in an event box.

Irv
_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

  • Root
  • » GTK+
  • » 4 short questions about the use of GTK [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support