Matthias Melcher wrote:

... lots of good things, please read the original message.

For brevity, I do only comment a few things here:

>>     virtual void draw() {
>> Fl_Window::draw();                  // Draw window widget first
>> if ( pBGImage )
>> pBGImage->draw(x(),y());            // draw PNG image over the above
>                  ~~~~~~~
> Do not draw at x and y. Classes derived from Fl_Window always have a
> coordinate system that starts at 0, 0 for the top left corner. X and y
> though are set relative to the parent window. I am surprised that you image
> renders at all ;-).

That's because he calls it with X = Y = 0.

> Since new windgets are automatically added to the current group, your new
> splashWindow actually becomes a part of myWindow, positioned at X/Y relative
> to the top left of myWindow.
> 
> Instead, you could call Fl_Group::current(0L) before creating the new splash
> window and begin() after creating the splash, so that the button is added to
> the main window, and not the splash window.

or simply create the splash window after the end() statement.

...

>> Fl::check();                    // give fltk some cpu to update the screen
> Check() does not update the screen. It checks for new events and handles
> those. Flush() updates the screen. Wait(0) should do both. But they are not
> needed here anyways.

Ah, no. Fl::check() _does_ update the screen. In fact, it calls Fl::wait(0).

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

Reply via email to