On 30.10.2009, at 18:02, Harvey Chapman wrote:

> Normally, I have "return Fl::run()" at the end of my programs.
> However, I'm currently writing an app that should appear and disappear
> periodically. Fl::run() does not work in this case because it exits
> when no more windows are visible. Is there a way to keep going as long
> as any window exists or perhaps as long as my main window exists?
>
> Something like...
>
> while (any_window_exists) wait(FOREVER);
>
> or
>
> // Not sure how this would work...
> Fl_Window *w;
>  while (w_exists) wait(FOREVER);
>
> Actually, I guess I could just do it the old fashioned way:
>
> bool quit = false;
> while (!quit) wait(FOREVER);

The original function is:

int Fl::run() {
   while (Fl_X::first) wait(FOREVER);
   return 0;
}

so as long as there is one window visible, run() will not return.

How about:

while (myWindow->shown()) Fl::run();

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

Reply via email to