#include once "fltk-c.bi"

'test of:
' Fl_WindowExNew
' Fl_WindowExSetResizeCB
' Fl_WidgetSetUserData
' Fl_WidgetGetUserData
' Fl_BoxNew

sub ResizeCB cdecl (self as any ptr, x as integer, y as integer, w as integer, h as integer)
  ' center the hello world box
  Fl_WidgetResize(Fl_WidgetGetUserData(self), w/2-50, h/2-12,100,24)
end sub

dim as Fl_WindowEx ptr Win = Fl_WindowExNew(320,200, "Resize Me ...")
Fl_WindowExSetResizeCB Win,@ResizeCB
Fl_WidgetSetUserData Win,Fl_BoxNew(20,40,100,24,"Hello, World!")
Fl_WindowSizeRange Win,160,100

Fl_WindowShow Win
Fl_Run
