#include once "fltk-c.bi"

'test of:
' DrawSetFont
' DrawStr
' DrawStrRot

sub DrawCB cdecl (self as any ptr)
  dim as integer w =Fl_WidgetGetW(self)
  dim as integer h =Fl_WidgetGetH(self)
  dim as integer d = 180
  for f as integer = 0 to 15
    DrawSetFont f,6+rnd*70
    for i as integer = 0 to 1
      DrawSetRGBColor rnd*255,rnd*255,rnd*255
      dim as integer x=rnd*w
      dim as integer y=rnd*h
      if i and 1 then
        DrawStr "DrawStr()",x,y
      else
        DrawStrRot d,"DrawStrRot()",x,y
        d+=5
      end if
    next
  next
end sub

dim as Fl_Window ptr win = Fl_WindowNew(640,480,"drawing02 resize me ...")
dim as Fl_BoxEx  ptr box = Fl_BoxExNew(5,5,630,470)
Fl_BoxExSetDrawCB box,@DrawCB
Fl_GroupSetResizable win,box
Fl_WindowShow win
Fl_Run
