On 24 Apr 2007, at 17:45, Stan wrote:
>>>         win.show();     // sidebar: how come putting this
>>>                         // below causes crash?
>>>         if(argc > 1) {
>>>                 Fl::grab(&win);
>>>         }
>>>         // win.show();
>>
>>
>> I'd hazard that this is a problem because your window has never been
>> shown at all (if called the other way) so probably doesn't really  
>> exist
>> yet...
>> The grab() docs say "The window does not have to be shown()" but I  
>> think
>> it maybe has to have been shown at some point for the grab to work  
>> OK.
>> Or maybe not...?
>
>   I don't follow you -- the window is shown() in both modes I think.

What I was try to get at was whether the window has ever been shown  
before the call to grab() or not...

e.g.
        win.show();
        Fl::grab(&win);

might conceivably be different to:

        Fl::grab(&win);
        win.show();

If the act of calling show() on the window the first time creates/ 
modifies the windows internal structures (which I think it does...)


>> Also, the docs say "under both X and WIN32 some window must be mapped
>> because the system interface needs a window id" which I guess would
>> certainly apply in your case, since there is only the one window?
>>
>
>   Yeah, I saw that, but it just caused my eyes to glaze over :)
>   What does it mean?

Basically it means your app has to have at least one window shown to  
make sure that the WM will send you events and such properly. In your  
case, where you try and grab() before you have a window shown, it all  
goes a bit pear-shaped...


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to