eumandy/eugtk/examples/test202.ex
2016-11-25 00:33:18 -07:00

55 lines
1.5 KiB
Elixir

-----------------------------------------------------------------
--# GtkFlowBox
-----------------------------------------------------------------
include GtkEngine.e
requires("3.12","GtkFlowBox")
constant win = create(GtkWindow,{
{"title","FlowBox ~ RESIZE ME!"},
{"border width",10},
{"position",GTK_WIN_POS_CENTER},
{"default size",300,300},
{"signal","destroy","Quit"}})
constant fb = create(GtkFlowBox,"homogeneous=FALSE,max children per line=2")
add(win,fb)
sequence ob = repeat(0,4)
ob[1] = create(GtkImage,"thumbnails/clown.svg")
ob[2] = create(GtkImage,create(GdkPixbuf,"thumbnails/eugtk.png",100,0,1))
ob[3] = create(GtkSpinButton,0,10,1)
ob[4] = create(GtkButton,"gtk-about","ShowDocs")
add(fb,ob)
show_all(win)
main()
global function ShowDocs()
Info(,"FlowBox",
"A GtkFlowBox",
`positions child widgets in sequence
according to its orientation.
For instance, with the horizontal orientation,
the widgets will be arranged from left to right,
starting a new row under the previous row when
necessary. Reducing the width in this case will
require more rows, so a larger height will be
requested.
Likewise, with the vertical orientation,
the widgets will be arranged from top to bottom,
starting a new column to the right when necessary.
Reducing the height will require more columns,
so a larger width will be requested.
The children of a GtkFlowBox can be dynamically
sorted and filtered.`)
return 1
end function