55 lines
1.5 KiB
Elixir
55 lines
1.5 KiB
Elixir
|
|
-------------------------------------------------------------------------------
|
|
--# GtkScrolledWindow
|
|
-- container which holds an object larger than the space allocated, with scroll
|
|
-- bars to allow seeing the entire object.
|
|
-- Often used for lists, images, etc.
|
|
-------------------------------------------------------------------------------
|
|
|
|
include GtkEngine.e
|
|
|
|
constant win = create(GtkWindow,
|
|
"size=300x300,border_width=10,position=1,$destroy=Quit")
|
|
|
|
constant scrolwin = create(GtkScrolledWindow)
|
|
add(win,scrolwin)
|
|
|
|
constant hadj = get(scrolwin,"hadjustment")
|
|
|
|
constant scroller = create(GtkViewport)
|
|
add(scrolwin,scroller)
|
|
|
|
constant panel = create(GtkBox,VERTICAL)
|
|
add(scroller,panel)
|
|
|
|
constant img1 = create(GtkImage,"thumbnails/giraffe.jpg")
|
|
add(panel,img1)
|
|
|
|
constant lbl = create(GtkLabel,{
|
|
{"markup","Various items in a <b><u>GtkScrolledWindow</u></b>"},
|
|
{"font","8"}})
|
|
add(panel,lbl)
|
|
|
|
constant
|
|
btnbox = create(GtkButtonBox),
|
|
btn1 = create(GtkButton,"gtk-quit","Quit"),
|
|
btn2 = create(GtkButton,"gtk-help",_("Foo"))
|
|
add(btnbox,{btn1,btn2})
|
|
pack(panel,-btnbox)
|
|
|
|
show_all(win)
|
|
set(hadj,"value",220)
|
|
|
|
main()
|
|
|
|
------------------------------------------------------------------
|
|
function Foo()
|
|
------------------------------------------------------------------
|
|
Info(win,"Test47","<u>GtkScrolledWindow</u>",
|
|
"You can pack any kind of item into this\n\n" &
|
|
"<small><i>Note: the scrollbars appear only if the\n" &
|
|
"window is too small for the contents</i></small>")
|
|
return 1
|
|
end function
|
|
|