38 lines
1001 B
Elixir
38 lines
1001 B
Elixir
|
|
--# Toolbars
|
|
|
|
include GtkEngine.e
|
|
|
|
add(builder,"~/demos/glade/toolbar.glade")
|
|
|
|
constant
|
|
fish = create(GdkPixbuf,"thumbnails/fish.png",30,30),
|
|
fox = create(GdkPixbuf,"thumbnails/fox.png",30,30),
|
|
mouse = create(GdkPixbuf,"thumbnails/mouse.png",30,30),
|
|
names = {"Fish","Fox","Mouse"},
|
|
pix = {fish,fox,mouse}
|
|
|
|
atom item -- seems to be no way to create a toolbutton in Glade.
|
|
for i = 1 to 3 do
|
|
item = create(GtkToolButton,create(GtkImage,pix[i]),names[i],"Foo",i)
|
|
set("toolbar1","insert",item,-1)
|
|
show_all(item)
|
|
end for
|
|
|
|
main()
|
|
|
|
-----------------------------------------------------------------------
|
|
global function on_checkbutton1_toggled(ToggleButton self)
|
|
-----------------------------------------------------------------------
|
|
set("toolbar1","style",get(self,"active")*2)
|
|
return 1
|
|
end function
|
|
|
|
|
|
--------------------------------------
|
|
global function Foo(atom ctl)
|
|
--------------------------------------
|
|
set("label1","text",get(ctl,"label"))
|
|
return 1
|
|
end function
|