Hannes Mueller wrote:
He would like to have some kind of animated GIF playing,
while the application initializes.
Is there any way to accomplish this?
wx.animate.GIFAnimationCtrl()
might help.
-Chris
Thanks, I found the GIF animation demo. Do you have an Idea how to implement something like a splash screen with it?
I tried already, but did not reach a working solution yet...
The main thing to keep in mind is that GIFAnimationCtrl relies on timers to know when to show the next frame, and also needs to get paint events, so the MainLoop needs to be running and dispatching events at a steady rate. This contrasts a bit with the typical use of a splash screen, which is to show it and then go off and do time consuming things to initialize the App, and all of this before app.MainLoop is called. So for the animation to work well you'll need to have already started the main loop, and not do anything in the gui thread that would be time-consuming and would block events from being delivered.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Robin Dunn wrote:
> Hannes Mueller wrote:
>> Christopher Barker wrote:
>>>
>>> Hannes Mueller wrote:
>>> He would like to have some kind of animated GIF playing,
>>>> while the application initializes.
>>>>
>>>> Is there any way to accomplish this?
>>>
>>> wx.animate.GIFAnimationCtrl()
>>>
>>> might help.
>>>
>>> -Chris
>>>
>>
>> Thanks, I found the GIF animation demo. Do you have an Idea how to
>> implement something like a splash screen with it?
>> I tried already, but did not reach a working solution yet...
>
> The main thing to keep in mind is that GIFAnimationCtrl relies on timers
> to know when to show the next frame, and also needs to get paint events,
> so the MainLoop needs to be running and dispatching events at a steady
> rate. This contrasts a bit with the typical use of a splash screen,
> which is to show it and then go off and do time consuming things to
> initialize the App, and all of this before app.MainLoop is called. So
> for the animation to work well you'll need to have already started the
> main loop, and not do anything in the gui thread that would be
> time-consuming and would block events from being delivered.
>
Thanks! That's info I can work with
I will talk to the client about this animation business, perhaps we can
find another solution
I didn't imagine it was so complicated to modify AdvancedSplash:
actually, I am also using a timer inside that class, not to change the
background image but to change the text painted in the splash screen
to show some kind of progress in loading. You can see it by looking at
the demo. So, if I can paint different texts using a timer, you can
fairly easily use a set of images (instead of the GIF animation
control) and switch image based on a similar timer. It looks to me
about 20 lines of code, as long as the images have the same dimensions
and as long as I am not missing anything else...