38 lines
993 B
Elixir
38 lines
993 B
Elixir
|
|
||
|
-----------------------------------------------------------------
|
||
|
--# GtkScale
|
||
|
-----------------------------------------------------------------
|
||
|
|
||
|
include GtkEngine.e
|
||
|
|
||
|
constant docs = `<u><b>GtkScale</b></u>
|
||
|
Try clicking with left, middle and right mouse buttons on
|
||
|
the scale slider at various places to see what happens.
|
||
|
Also try mouse scroll wheel.
|
||
|
`
|
||
|
constant win = create(GtkWindow,"size=250x100,border=10,position=1,$destroy=Quit")
|
||
|
|
||
|
constant panel = create(GtkBox,"orientation=VERTICAL")
|
||
|
add(win,panel)
|
||
|
|
||
|
constant scale = create(GtkScale,{
|
||
|
{"orientation",HORIZONTAL},
|
||
|
{"range",0,100},
|
||
|
{"increments",12.5,25}, -- step, page
|
||
|
{"digits",0},
|
||
|
{"draw value",TRUE},
|
||
|
{"value pos",GTK_POS_BOTTOM}})
|
||
|
pack(panel,scale,TRUE,TRUE,10)
|
||
|
|
||
|
constant caps = {"Empty","One Quarter","One Half","Three Quarters","Full"}
|
||
|
for i = 0 to length(caps)-1 do
|
||
|
set(scale,"add mark",i*25,GTK_POS_TOP,caps[i+1])
|
||
|
end for
|
||
|
|
||
|
constant lbl = create(GtkLabel)
|
||
|
set(lbl,"markup",docs)
|
||
|
add(panel,lbl)
|
||
|
|
||
|
show_all(win)
|
||
|
main()
|