#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_Check_Browser extends Fl_Browser_ http://www.fltk.org/doc-1.3/classFl__Check__Browser.html

' Fl_Browser_SetTextColor
' Fl_Browser_SetHasScrollbar

' Fl_Check_BrowserNew
' Fl_Check_BrowserAdd
' Fl_Check_BrowserSetChecked
' Fl_Check_BrowserNItems
' Fl_Check_BrowserGetChecked
' Fl_Check_BrowserText

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

dim as Fl_Check_Browser ptr cb = Fl_Check_BrowserNew(10,10,320-20,100-20)

Fl_Browser_SetTextColor cb, FL_RGB_Color(255,128,128)

Fl_Browser_SetHasScrollbar cb, FL_SCROLL_VERTICAL_ALWAYS

Fl_Check_BrowserAdd cb,"item 1"
Fl_Check_BrowserAdd cb,"item 2"
Fl_Check_BrowserAdd cb,"item 3"
Fl_Check_BrowserAdd cb,"item 4"
Fl_Check_BrowserAdd cb,"item 5"
Fl_Check_BrowserAdd cb,"item 6"
Fl_Check_BrowserAdd cb,"item 7"
Fl_Check_BrowserAdd cb,"item 8"

Fl_Check_BrowserSetChecked cb,1
Fl_Check_BrowserSetChecked cb,3
Fl_Check_BrowserSetChecked cb,8

dim as integer nItems = Fl_Check_BrowserNItems(cb)
if nItems>0 then
  for item as integer = 1 to nItems
    if Fl_Check_BrowserGetChecked(cb,item) then
      ? "[*] ";
    else
      ? "[ ] ";
    end if
    ? *Fl_Check_BrowserText(cb,item)
  next
end if


Fl_WindowShow Win
Fl_Run
