I created a button that when clicked on will open a new window through callback but when this button is clicked nothing happens but when it is released it blinks the new window and does not allow me to see the content in the new window. Please any help would be appreciated.
The callback
//Callback for advanced search
static void ad_cb(Fl_Button *theButton, void*)
{
Fl_Window adw (10,10,600,400);
Fl_Button adcc (30,40,120,20,"Advanced Search");
adcc.tooltip ("Make advanced search");
adw.show();
}
The Button
Fl_Button ad (30,460 + 40,120,20,"Advanced Search");
ad.tooltip ("Make advanced search");
ad.callback((Fl_Callback*)ad_cb);
The destructor is called as soon as the function exits. That is why you just see a flash. Change it to
//Callback for advanced search
static void ad_cb(Fl_Button *theButton, void*)
{
Fl_Window* adw = new Fl_Window (10,10,600,400);
Fl_Button* adcc = new Fl_Button (30,40,120,20,"Advanced Search");
adcc->tooltip ("Make advanced search");
adw->show();
}
You can close the window by hitting the x in the top corner.