-
Notifications
You must be signed in to change notification settings - Fork 1
/
Fl_Hold_Browser03.nim
44 lines (35 loc) · 1.04 KB
/
Fl_Hold_Browser03.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import fltk_main
#test of:
# class Fl_Hold_Browser extends Fl_Browser http://www.fltk.org/doc-1.3/classFl__Hold__Browser.html
# Fl_WidgetSetType class, FL_MULTIBROWSER
# Fl_WidgetSetSelectionColor
# Fl_BrowserAdd
# Fl_BrowserInsert
# Fl_BrowserGetSize
# Fl_BrowserGetText
var win = Fl_WindowNew(320,100,"Fl_Hold_Browser (SelectionColor)")
var br = Fl_Hold_BrowserNew(10,10,320-20,100-20)
Fl_Browser_SetHasScrollbar br, FL_SCROLL_VERTICAL_ALWAYS
#~ Fl_WidgetSetType br, FL_MULTIBROWSER
Fl_WidgetSetType br, 3
Fl_WidgetSetSelectionColor br,Fl_BLUE
Fl_BrowserAdd br,"item 1"
Fl_BrowserAdd br,"item 2"
Fl_BrowserAdd br,"item 3"
Fl_BrowserAdd br,"item 4"
Fl_BrowserAdd br,"item 5"
Fl_BrowserAdd br,"item 6"
Fl_BrowserAdd br,"item 7"
Fl_BrowserAdd br,"item 8"
Fl_BrowserInsert br,3,"item 2b"
Fl_BrowserSelect br,1
Fl_BrowserSelect br,3
Fl_BrowserSelect br,5
var
nitems = Fl_BrowserGetSize(br)
item = 0
if nItems>0 :
for item in 1 .. nItems:
echo $Fl_BrowserGetText(br,item)
Fl_WindowShow win
Fl_Run()