[wxPython-users] Splash screen refresh issue

Robin Dunn robin at alldunn.com
Thu Jan 3 09:51:21 PST 2008


David Poundall wrote:
>>> Robin Wrote:
>>> #1 rule in GUI programming (well, 2nd one, after "Choose wxPython"
>>> <wink!>) is  to never block the GUI thread.  If you stop the flow of
>>> control from getting into or getting back to the MainLoop then events
>>> (like the paint events for the splash screen) will not be delivered to
>>> their handlers.
>>>
>>> See http://wiki.wxpython.org/LongRunningTasks
>>>
>> David Wrote:
>> Clean forgot about that one Robin, thanks for the polite poke.
>>
> 
> On a final note to do with splash screens, the difference between these two
> splash screen codes ...
> 
[...]
> ... appears to be that the second code has an OnPaint.  

So does the first class, it just happens to be in the base class instead 
of yours.



> The advantage of the wx.Frame based class is that a Bitmap mask can be used
> on the frame – and that is the only advantage.  IF a .png were used with a
> transparent layer instead, the wx.Frame approach may well be able to be
> written so that it too uses only a single show event, and then it too would
> work.   I don’t have a .png set up like this so I can’t check it out.


The frame would still be behind the png image, so even if it has 
translucent areas all you would see would be the frame's background, not 
the desktop.  There are ways to do that, but they are not covered by the 
wx API yet.

> PS You can’t run the console build in it’s own thread because it is then not
> in the main GUI thread, you get messaging conflicts, and I think that this
> breaks Robins Third rule.

Hmm...  m'thinks I should start writing these down...

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!




More information about the wxpython-users mailing list