Reputation: 1350
I was trying to put an animated gif in a wxpython panel but apparently there is no animarion nor adv package in my wxpython version:
In [1]: import wx
In [2]: wx.version()
Out[2]: '4.0.1 gtk3 (phoenix)'
Then i tried to use the gif as a wx.Bitmap
but of course it would not play. I know that according to phoenix documention:
https://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html
the gif handler class is MISSING, but i was wondering if there is any way to use a gif (threding maybe?) in phoenix.
Upvotes: 3
Views: 2064
Reputation: 22453
wx.adv contains Animation
and AnimationCtrl
Ripped out of the demo's
import wx
from wx.adv import Animation, AnimationCtrl
class TestPanel(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1)
sizer = wx.BoxSizer(wx.VERTICAL)
anim = Animation('/home/rolf/loveyourjob5qj.gif')
ctrl = AnimationCtrl(self, -1, anim)
ctrl.Play()
sizer.Add(ctrl)
self.SetSizerAndFit(sizer)
self.Show()
if __name__ == '__main__':
test=wx.App()
TestPanel(None)
test.MainLoop()
Upvotes: 5