eumandy/eugtk/examples/test98.ex

40 lines
1004 B
Elixir
Raw Normal View History

2016-11-25 00:33:18 -07:00
-------------------------------------------------------
--# Mnemonic Labels
-------------------------------------------------------
include GtkEngine.e
constant docs = `<u><b>Mnemonic Label</b></u>
Use alt-E to activate this one.`
constant win = create(GtkWindow,"size=300x100,border_width=5,position=1,$destroy=Quit")
constant panel = create(GtkBox,"orientation=VERTICAL")
add(win,panel)
constant lbl1 = create(GtkLabel)
set(lbl1,"markup",docs)
add(panel,lbl1)
constant lbl2 = create(GtkLabel)
set(lbl2,"markup with mnemonic","Fred &amp; _Ethel")
add(panel,lbl2)
constant btn1 = create(GtkButton,"gtk-quit","Quit")
constant btn2 = create(GtkButton,"gtk-ok",_("Foo"))
constant btnbox = create(GtkButtonBox)
add(btnbox,{btn1,btn2})
pack(panel,-btnbox)
set(lbl2,"mnemonic widget",btn2)
show_all(win)
main()
------------------------
function Foo()
------------------------
set(lbl2,"markup","Fred &amp; Ethel,\n<b><i>The Mertzes</i></b>")
return 1
end function