То perform some action with a button you need to pass a call back function:
void cancel_callback(Fl_Widget* obj, void* data)
{
..
//do something
..
}
...
cancel = new Fl_Button(x, y, x1, y1, "Cancel");
cancel->callback(cancel_callback,(void*)this);
Its unsafe to update UI from threads. It should be done only from main thread. Use Fl::awake (Fl_Awake_Handler cb, void *message=0)
in your thFn to execute some callback function within main thread.
void updateUI(void *userdata)
{
...
// update UI
...
}
void* thFn(void* param)
{
...
Fl::awake(updateUI, userdata);
}