[wxPython-users] Animated Gif as Button

Robin Dunn robin at alldunn.com
Wed Aug 2 11:59:05 PDT 2006


Ben Harling wrote:
> Done it, thanks again Robin, sorry to clutter up the mailing list.
> 
> Code:
> Self.AdBanner.Bind(wx.EVT_LEFT_UP, self.AdBannerClicked, self.AdBanner)
> 
> So simple... !

Yep.

If you want to get a little fancier and make it look/act like a real 
button you could derive a class from one of the generic button classes 
in wx.lib.buttons and instead of drawing a normal wx.Bitmap for it's 
label use a wx.animate.GIFAnimation to get the frames and delays from a 
GIF file and draw those for the label using a timer.  It would be a good 
exercise to help you get over your noobiness ;-)

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





More information about the wxpython-users mailing list