#include once "fltk-c.bi"

'test of:
' class Fl_Browser_ extends Fl_Group    http://www.fltk.org/doc-1.3/classFl__Browser__.html
' class Fl_Browser  extends Fl_Browser_ http://www.fltk.org/doc-1.3/classFl__Browser.html

' Fl_Browser_SetTextColor
' Fl_Browser_SetHasScrollbar

' Fl_BrowserNew
' Fl_BrowserAdd
' Fl_BrowserInsert
' Fl_BrowserSelect
' Fl_BrowserGetSize
' Fl_BrowserGetText

dim as Fl_Window ptr Win = Fl_WindowNew(320,100)

dim as Fl_Browser ptr br = Fl_BrowserNew(10,10,320-20,100-20)

Fl_Browser_SetTextColor br,FL_RGB_Color(0,128,128)

Fl_Browser_SetHasScrollbar br, FL_SCROLL_VERTICAL_ALWAYS

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,3

dim as integer nitems = Fl_BrowserGetSize(br)
if nItems>0 then
  for item as integer = 1 to nItems
    ? *Fl_BrowserGetText(br,item)
  next
end if

Fl_WindowShow Win
Fl_Run
