75 lines
2.1 KiB
Elixir
75 lines
2.1 KiB
Elixir
|
|
||
|
---------------------------------------------------------------------------------
|
||
|
--# GtkActionBar
|
||
|
---------------------------------------------------------------------------------
|
||
|
|
||
|
include GtkEngine.e
|
||
|
|
||
|
constant docs = `<b><u>GtkActionBar</u></b>
|
||
|
|
||
|
GtkActionBar is designed to present contextual actions. It is expected to be
|
||
|
displayed below the content and expand horizontally to fill the area.
|
||
|
|
||
|
It allows placing children at the start or the end. In addition, it contains
|
||
|
an internal centered box which is centered with respect to the full width of
|
||
|
the box, even if the children at either side take up different amounts of space.
|
||
|
|
||
|
`
|
||
|
requires("3.12","GtkActionBar")
|
||
|
|
||
|
constant win = create(GtkWindow,{
|
||
|
{"title","ActionBar"},
|
||
|
{"border width",10},
|
||
|
{"position",GTK_WIN_POS_CENTER},
|
||
|
{"default size",300,300},
|
||
|
{"signal","destroy","Quit"}})
|
||
|
|
||
|
constant panel = create(GtkBox,VERTICAL)
|
||
|
add(win,panel)
|
||
|
|
||
|
constant lbl = create(GtkLabel)
|
||
|
set(lbl,"markup",docs)
|
||
|
add(panel,lbl)
|
||
|
|
||
|
constant ab = create(GtkActionBar)
|
||
|
pack_end(panel,ab)
|
||
|
|
||
|
constant
|
||
|
tb1 = create(GtkToolButton,"$clicked=Quit"),
|
||
|
img1 = create(GdkPixbuf,"gtk-quit",25,25)
|
||
|
set(tb1,"icon widget",create(GtkImage,img1))
|
||
|
set(tb1,"tooltip markup","<b>Quit</b>")
|
||
|
set(ab,"pack start",tb1)
|
||
|
|
||
|
constant
|
||
|
tb2 = create(GtkToggleToolButton),
|
||
|
img2 = create(GdkPixbuf,"thumbnails/dragon.png",25,25)
|
||
|
set(tb2,"icon widget",create(GtkImage,img2))
|
||
|
set(tb2,"tooltip text","Toggle Button")
|
||
|
set(ab,"center widget",tb2)
|
||
|
|
||
|
constant
|
||
|
tb3 = create(GtkRadioToolButton),
|
||
|
img3 = create(GdkPixbuf,"thumbnails/fish.png",25,25)
|
||
|
set(tb3,"icon widget",create(GtkImage,img3))
|
||
|
set(tb3,"tooltip markup","<small>Goldfish</small>")
|
||
|
set(ab,"pack end",tb3)
|
||
|
|
||
|
constant
|
||
|
tb4 = create(GtkRadioToolButton,tb3),
|
||
|
img4 = create(GdkPixbuf,"thumbnails/fish.png",40,40)
|
||
|
set(tb4,"icon widget",create(GtkImage,img4))
|
||
|
set(tb4,"tooltip text","Porpoise")
|
||
|
set(ab,"pack end",tb4)
|
||
|
|
||
|
constant
|
||
|
tb5 = create(GtkRadioToolButton,tb4),
|
||
|
img5 = create(GdkPixbuf,"thumbnails/fish.png",60,60)
|
||
|
set(tb5,"icon widget",create(GtkImage,img5))
|
||
|
set(tb5,"tooltip markup","<big>Whale</big>")
|
||
|
set(ab,"pack end",tb5)
|
||
|
|
||
|
show_all(win)
|
||
|
main()
|
||
|
|