-------------------------------
-- Buttons
-------------------------------
include GtkEngine.e
include GtkRoutines.e
include GtkEnums.e
include dll.e
constant win = create(GtkWindow)
connect(win,"destroy",quit)
set(win,"border_width",10)
set(win,"position",GTK_WIN_POS_CENTER)
set(win,"default size",200,300)
constant panel = create(GtkVBox)
add(win,panel)
constant btn1 = create(GtkCheckButton,"_Check me out!")
set(btn1,"tooltip text","GtkCheckButton")
pack(panel,btn1)
constant rb1 = create(GtkRadioButton,0,"Radio One")
set(rb1,"tooltip text","Radio button - group = 0")
constant rb2 = create(GtkRadioButton,rb1,"Radio Two")
set(rb2,"tooltip text","Radio button - group = rb1")
pack(panel,{rb1,rb2})
constant sep = create(GtkHSeparator)
pack(panel,sep)
constant rb3 = create(GtkRadioButton,0,"Radio _Uno")
set(rb3,"tooltip text","GtkRadioButton - group = 0")
constant rb4 = create(GtkRadioButton,rb3,"Radio _Dos")
set(rb4,"tooltip text","GtkRadioButton - group = rb3")
pack(panel,{rb3,rb4})
constant tbn = create(GtkToggleButton,"_Toggle button")
set(tbn,"tooltip text","GtkToggleButton")
pack(panel,tbn)
constant okbtn = create(GtkButton,"gtk-ok")
set(okbtn,"tooltip text","GtkButton from GTK Stock")
pack(panel,okbtn)
constant btn2 = create(GtkButton)
set(btn2,"tooltip text","A blank button with label using markup")
pack(panel,btn2)
constant btnface2 = create(GtkHBox)
add(btn2,btnface2)
constant lbl2 = create(GtkLabel)
set(lbl2,"markup","Big Text")
add(btnface2,lbl2)
constant btn3 = create(GtkButton)
pack(panel,btn3)
constant img3 = create(GtkImage,"checkmark.gif")
set(btn3,"tooltip text",
"Use an animated gif on a button!\n"
& "(can have a label here as well)")
add(btn3,img3)
constant btn4 = create(GtkButton)
set(btn4,"tooltip text","Fancy custom button\nwith image and text")
pack(panel,btn4)
constant img4 = create(GtkImage,"BabyTux.png")
constant lbl4 = create(GtkLabel," Tux the Penguin")
constant btnface4 = create(GtkHBox)
add(btn4,btnface4)
pack(btnface4,{img4,lbl4})
constant btn5 = create(GtkFileChooserButton)
set(btn5,"tooltip text","File Chooser Button")
pack(panel,btn5)
constant btn6 = create(GtkFontButton,"Courier 12")
set(btn6,"tooltip text","Font Button")
pack(panel,btn6)
show_all(win)
main()
---------------------------------------------------------------
-- Copyright 2008 by Irv Mullins - code released under the LGPL
---------------------------------------------------------------