News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

The 28 march 2006 build is out.

Started by killerbot, March 28, 2006, 06:15:01 PM

Previous topic - Next topic

Ceniza

I still wonder if those bugs are my fault...

The current implementation of cbSplashScreen is really close, almost the same, to that of wxSplashScreen. The main difference is cbSS paints over the frame and wxSS uses an extra Window to draw.

thomas

It is not your fault, we had similar problems with wxSplashScreen before, but worked around them ;)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

sethjackson

Quote from: thomas on March 29, 2006, 09:24:35 PM
Well, look at app.cpp, line 575. Whatever is in that header, the default value is not used. Changing the default value in the header does not fix anything.

Yiannis was working on the startup problems yesterday afternoon, I thought he had fixed everything. Maybe there's more than one thing. Whatever it is, it is not the wxSTAY_ON_TOP flag, however. :)

Ok. Point taken. :D

Pecan


This patch seems to have fixed the Splash loop on my XP
system with SVN 2290.

A statement in the wxWidgets book states that the paint
routine should always allocated a DC even if it doesn't do the paint.
This avoids a loop with the lib constantly calling the paint
routine.

I moved the DC allocation to the top of the routine so it was
allocated on every paint call and the hang went away.

Patch submitted.


Index: src/src/splashscreen.cpp
===================================================================
--- src/src/splashscreen.cpp (revision 2290)
+++ src/src/splashscreen.cpp (working copy)
@@ -22,12 +22,16 @@

void cbSplashScreen::OnPaint(wxPaintEvent &)
{
+    // an obscure statement in the wxWidgets book says to
+    // allocate the DC even if you don't paint to avoid
+    // a paint loop.    //pecan 2006/04/3
+  wxPaintDC paint_dc(this); //pecan 2006/04/3
   if (m_painted)
   {
     return;
   }

-  wxPaintDC paint_dc(this);
+  //-wxPaintDC paint_dc(this);
   DoPaint(paint_dc);
   m_painted = true; // paint once
}


thanks
pecan

Ceniza

Good catch. I was even considering to remove the "paint once" thingy from there.

I'll modify my SVN copy to reflect that so it can be updated from there.

Thanks :)