[wxpython-users] buttonpanel: how to set hover images on buttons
Andrea Gavana
andrea.gavana at gmail.com
Tue Sep 30 22:16:16 PDT 2008
Hi Andrew,
On Wed, Oct 1, 2008 at 2:52 AM, Andrew Carswell wrote:
> I'm using wx.lib.buttonpanel – it's great! However I am having difficulty
> trying to set and unset 'hover' images on buttons.
>
> How should I code the following:
>
>
>
> def someMethod(self, event):
>
> if self.btn.GetStatus() == "Hover":
>
> self.btn.SetBitmap(wx.Bitmap("hoverImage.png", wx.BITMAP_TYPE_PNG))
>
>
>
>
>
> I want to trigger the 'hover' image when the mouse is over the button and
> then reset it upon mouse exit.
>
> What events should I use to set and unset the hover image?
>
> If only there were a SetBitmapHover method as there is with bitmap buttons…
There is, but it's called SetBitmap. You create a button using the
ButtonInfo class, and then you use something like this:
button.SetBitmap(myBmp, "Hover")
or:
button.SetBitmap(myBmp, "Disabled")
HTH.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
More information about the wxpython-users
mailing list