Re: 4 short questions
- From: Irv Mullins <irvm ellijay com>
- To: gtk-list gnome org
- Subject: Re: 4 short questions
- Date: Sat, 19 Nov 2005 18:21:24 -0500
On Saturday 19 November 2005 12:00 pm, gtk-list-request gnome org 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([img1,img2])
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([lbl1,lbl2])
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]