#include once "fltk-c.bi"


'test of:
' Fl_WidgetSetCallbackArg

' near the same as Fl_Input03.bas
' but the userdata callback argument (self) points to an Fl_Input_ ptr now.

sub InputCB cdecl (widget as Fl_Widget ptr, self as any ptr)
 print "InputCB: " & *Fl_Input_GetValue(self)
end sub

dim as Fl_Window ptr win = Fl_WindowNew(320,200)
dim as Fl_Input_ ptr me
me = Fl_InputNew          (120, 5,190, 20,"Fl_Input:")
Fl_WidgetSetCallbackArg me,@InputCB,me

me = Fl_Int_InputNew      (120,30,190, 20,"Fl_Int_Input:")
Fl_WidgetSetCallbackArg me,@InputCB,me

me = Fl_Float_InputNew    (120,55,190, 20,"Fl_Float_Input:")
Fl_WidgetSetCallbackArg me,@InputCB,me

me = Fl_Multiline_InputNew(120,80,190,100,"Fl_Multiline_Input:")
Fl_WidgetSetCallbackArg me,@InputCB,me:Fl_WidgetSetWhen me,FL_WHEN_CHANGED

Fl_WindowShow win
Fl_Run