I guess first I have to determine if FLTK would be able to get me where I want too go. Since I would need to get text to display in the GUI window as a response to a button press, for example, this is the first problem for me. I have the code below which is not working as expected, when I press the button, I do not see "Button was clicked!" anywhere on the GUI window. Not sure why this is occurring.
At the moment I thinking of a GUI window with a menu bar across the top with selections for 'Start/Quit', 'COM Port', 'BAUD', as a starter, with the area below the menu bar to be a terminal interaction area. I guess if I could get to that point, that would be a very good start. So, the main question, how do I get some text to display in the GUI window, in response to a button press?
Code: Select all
'FLTK_first.bas
#INCLUDE "fltk-c.bi"
'Screen 12
DIM SHARED AS Fl_Window PTR Window_Main
DIM SHARED AS Fl_Box PTR Box_text
DIM SHARED AS Fl_Button PTR Button_Click
SUB Create_Window_Main()
Window_Main = Fl_WindowNew(300,200,"Button Test")
Box_text = Fl_BoxNew(100,80,100,20,"Welcome to FLTK")
Button_Click = Fl_ButtonNew(100,160,100,20,"Click me!")
END SUB
SUB Button_Click_Event CDECL(widget AS FL_Widget PTR)
'PRINT "Button was clicked!"
Fl_OutputNew(100,110,100,20,"Button was clicked!")
END SUB
Create_Window_Main()
Fl_WidgetSetCallback0(Button_Click,@Button_Click_Event())
Fl_WindowShow(Window_Main)
Fl_Run
END