Thanks to everyone with all the great analysis & suggestions.
I will try out as many as I can this evening.
A note on design intent, though - I should have added to the original posting 
;-(...

I built the splashWindow class into the constructor for the main window because 
I wanted to hide implementation details of this whole messy business from the 
init code in main(). I planned on building in a progress bar, etc, and I don't 
want implementation of all the "bells & whistles" (which are NOT important) 
cluttering up the initialization code / sequence for the application (which 
_IS_ important). I know I can just put my "important" stuff in a separate 
function ("important_stuff()"!), but it struck me that there should be a more 
clean & eloquent solution, given all the object-oriented magic fltk is based on 
- hiding details is the cornerstone.

Anyway - if two separate window classes & required to make the rubber hit the 
road, so be it!

Cheers,
Robb.



> > Albrecht Schlosser wrote:
> >
> > Sorry for the double posting of the code, please use the second (appended)
> > version, I changed some minor things and forgot to remove the first version.
>
> I tried the attached code (after cloning another png file to be
> splash-bg3.png) and I still get the noticeable delay that the OP was
> concerned with.
>
> Doubling the delay loop gave a corresponding increase in delay before
> the splash screen _image_ was displayed.  I get:
>
> splash win background -- delay -- splash image -- delay -- main win
>
> The sleep/usleep appears to be suspending everything before the image
> has a chance to display.  If I made the loop condition a hundred times
> bigger (300) and the sleep/usleep a hundred times smaller (10/10000),
> the image displays quickly.
>
> =====     =====     =====
>
>             for (int i=0; i<300; i++ ) {
>                 Fl::check();          // call this first
>         #ifdef WIN32
>                   Sleep ( 10 );
>         #else
>                   usleep( 10000 );
>         #endif
>             }
>
> =====     =====     =====
>
> That said, I agree that that the windows should be independent.
>
> --Scott.
>

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

Reply via email to