On Jul 19, 2007, at 3:49 PM, Stan wrote:
> [...]
>>
>> Yes, but this looks under the hood little bit different. When you
>> start
>> your application, you usually have main window and it's children
>> (or widgets).
> [...]
>> Hoping now is little bit clear how Fl::grab() works :-)
>
> Assuming what you've said is correct, what this tells
> me is that the documentation for Fl::grab() is quite wrong.
>
> void grab(Fl_Window&w) {grab(&w);}
> ... Send all events to the passed window no matter where the
> pointer or focus is...
>
> It should be something like "If w is the main window, [ as above ],
> otherwise [ .. fill in the blank ]"
I think the reason for grab() failing is a different one. Creating a
window does not actually map a system window yet, so there is nothing
to "grab" onto.
I suggest that before you use "grab", you call show() and the
Fl::flush() to make sure that window is actually visible before you
do anything fancy.
Or even:
myWin->show();
do {
Fl::flush();
} while (!myWin->visible() }
----
http://robowerk.com/
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk