added eugtk examples
This commit is contained in:
51
eugtk/examples/test119.ex
Normal file
51
eugtk/examples/test119.ex
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
-----------------------------------------------------------------
|
||||
--# GtkToolBar
|
||||
-----------------------------------------------------------------
|
||||
|
||||
include GtkEngine.e
|
||||
|
||||
constant docs = `<u><b>ToolBar</b></u>
|
||||
demos different styles of toolbar,
|
||||
this one uses stock button items.
|
||||
`
|
||||
constant cap = {"application-exit","gtk-apply","gtk-find"}
|
||||
|
||||
constant items = {
|
||||
create(GtkToolButton,cap[1],0,"Quit"),
|
||||
create(GtkToolButton,cap[2],0,_("Foo"),2),
|
||||
create(GtkToolButton,cap[3],0,_("Foo"),3)
|
||||
}
|
||||
|
||||
constant tips = {
|
||||
"Stock <b><i>gtk-quit</i></b> button\nClick to exit",
|
||||
"Stock <b><i>gtk-apply</i></b> button",
|
||||
"Stock <b><i>gtk-find</i></b> button"
|
||||
}
|
||||
|
||||
constant win = create(GtkWindow,"size=300x100,position=1,$destroy=Quit")
|
||||
|
||||
constant panel = create(GtkBox,"orientation=VERTICAL")
|
||||
add(win,panel)
|
||||
|
||||
constant toolbar = create(GtkToolbar,{
|
||||
{"icon size",GTK_ICON_SIZE_LARGE_TOOLBAR}})
|
||||
add(panel,toolbar)
|
||||
|
||||
for i = 1 to length(items) do
|
||||
set(toolbar,"insert",items[i],-1)
|
||||
set(items[i],"tooltip markup",tips[i])
|
||||
end for
|
||||
|
||||
constant doclbl = create(GtkLabel,{{"markup",docs}})
|
||||
add(panel,doclbl)
|
||||
|
||||
show_all(win)
|
||||
main()
|
||||
|
||||
----------------------------------------------
|
||||
function Foo(atom ctl, integer i)
|
||||
----------------------------------------------
|
||||
Info(win,,"You clicked",cap[i],,cap[i])
|
||||
return 1
|
||||
end function
|
||||
Reference in New Issue
Block a user