45 lines
1.2 KiB
Elixir
45 lines
1.2 KiB
Elixir
|
|
------------------------------------------------------------------------------
|
|
--# 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
|
|
|