DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2594
Version: 1.3-current
Attached file "focus2.cxx"...
Link: http://www.fltk.org/str.php?L2594
Version: 1.3-current
// 1) launch program; two windows are shown
// 2) press 'Command-w':
// - expected behaviour: the large window should be closed (thanks to
// the take_focus() call in main())
// - observed behaviour: the smallt window is closed
#include <stdio.h>
#include <stdlib.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
class myWindow : public Fl_Window {
private:
int handle(int event)
{
switch (event) {
case FL_SHORTCUT:
case FL_KEYBOARD:
if(Fl::test_shortcut(FL_META+'w')){
do_callback();
return 1;
}
break;
}
return Fl_Window::handle(event);
}
public:
myWindow(int w, int h, const char *l=0)
: Fl_Window(w, h, l) {}
};
myWindow *win, *win2;
int main(int argc, char **argv)
{
win = new myWindow(200, 200);
win->show(argc, argv);
win2 = new myWindow(100, 100);
win2->show();
win1->take_focus();
return Fl::run();
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs