#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

function HandleCB cdecl (self as any ptr,event as Fl_Event) as integer
  print "HandleCB " & event
  return 0 ' don't eat the event's
end function

dim as Fl_Window ptr Win = Fl_WindowNew(320,100)
dim as Fl_BrowserEx ptr br = Fl_BrowserExNew(10,10,320-20,100-20)
Fl_WidgetSetType br,FL_MULTIBROWSER
Fl_BrowserExSetHandleCB br,@HandleCB 

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

Fl_WindowShow Win
Fl_Run
