It appears that when grab() is on normal keyboard navigation
is off. Is this the case, or am I doing something wrong?
Example:
//////////////////////////////////////////////////////////////
#include <FL/Fl_Double_Window.H>
#include <FL/Fl.H>
#include <FL/Fl_Button.H>
#include <FL/Enumerations.H>
#include <cstdlib>
class MyWindow : public Fl_Double_Window {
public:
MyWindow(int x, int y, char const* label = 0)
: Fl_Double_Window(x, y, label)
{;}
int handle(int event)
{
if(event == FL_PUSH) {
std::exit(0);
}
return Fl_Double_Window::handle(event);
}
};
int main(int argc, char const* argv[])
{
MyWindow win(300, 300);
Fl_Button* b1 = new Fl_Button(50, 50, 100, 20, "one");
new Fl_Button(50, 70, 100, 20, "two");
new Fl_Button(50, 90, 100, 20, "three");
win.end();
b1->take_focus();
win.show(); // sidebar: how come putting this
// below causes crash?
if(argc > 1) {
Fl::grab(&win);
}
// win.show();
return Fl::run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk