On 18 Oct 2008, at 17:32, Jane wrote:

> why isnt piano finished drawing when i instanciate my other
> objects AFTER calling w_main->show(); ?
>
>     w_main->show();
>     ctrl = new ctrl(); // gets external data, feeds it to
> widget...widget however has not been drawn yet.

That is in the nature of many GUI systems - "show" asks for the  
widget to be shown and returns.
The fact that "show" has returned does not, however, guarantee that  
the widget is actually mapped onto the display yet, which is probably  
the issue you are hitting.

There are a few things you could try that might help:

- calling Fl::check(); after the show might help get the window  
mapped... Maybe even call it a few times just to be on the safe side!

- you might try calling piano->shown(); to see if it is shown, but I  
don't believe that reliably tells you if the window is mapped or not.

- You could show all your widgets, wait for short while then hope for  
the best!

- Wild guessing time: I don't know your implementation, but maybe you  
can make the widgets less sensitive to whether they are mapped or not  
by use absolute co-ords rather than relative co-ords? E.g. based on  
event_x_root() rather than on event_x()?

Any use?

-- 
Ian



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

Reply via email to