added eugtk examples
This commit is contained in:
44
eugtk/examples/test177.ex
Normal file
44
eugtk/examples/test177.ex
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
--# GtkAppChooserButton
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
include GtkEngine.e
|
||||
|
||||
constant docs = `<u>App Chooser Button</u>
|
||||
Click to show apps
|
||||
for text/plain
|
||||
`
|
||||
constant win = create(GtkWindow,
|
||||
"title=App Chooser Button,size=360x-1,position=1,border=10,$destroy=Quit")
|
||||
|
||||
constant panel = create(GtkBox,VERTICAL)
|
||||
add(win,panel)
|
||||
|
||||
constant lbl = create(GtkLabel)
|
||||
set(lbl,"markup",docs)
|
||||
add(panel,lbl)
|
||||
|
||||
constant f = create(GFile,"thumbnails/mongoose.png")
|
||||
constant ico = create(GFileIcon,f)
|
||||
|
||||
constant btn = create(GtkAppChooserButton,"text/plain")
|
||||
set(btn,"append custom item","Euphoria","Eu Editor",ico)
|
||||
pack(panel,btn)
|
||||
|
||||
set(btn,"show dialog item",TRUE)
|
||||
set(btn,"active custom item","Euphoria")
|
||||
|
||||
show_all(win)
|
||||
|
||||
connect(btn,"custom-item-activated","FooBar") -- must be done after window is shown.
|
||||
|
||||
main()
|
||||
|
||||
----------------------------------------------------------
|
||||
global function FooBar(atom ctl, object name)
|
||||
----------------------------------------------------------
|
||||
Info(win,,peek_string(name),"Custom item selected.")
|
||||
return 1
|
||||
end function
|
||||
|
||||
Reference in New Issue
Block a user