Akshada
Akshada

Reputation: 65

how to change wx.BitmapButton back to it's original state wxpython?

I am trying to get the current status of the bitmap button in the wx-python. I have 3 different button states i.e Clicked, Active, and Disable. The buttons will be at any of these states in real-time.

I am disabling all the buttons for 5 seconds and after that, I want to retain the states as it shown earlier. I tired using GetBitmap(), GetBitmapDisabled(), GetBitmapPressed() these function but it didnt work for me.

Let's take an example, We have button name keypad and it's current state can be active, disable or clicked state depends on the action Keypad_Active

Now on press of OK button -> keypad button will change to disable state for 5 second and after that how to revert back to it's original state?

I am facing difficulties in building the logic for this. It would be helpful you can suggest some way out.

Upvotes: 0

Views: 164

Answers (1)

VZ.
VZ.

Reputation: 22678

You shouldn't use bitmaps as proxies for the button status. Just store the current status explicitly in your program and update the button accordingly, whenever you change it.

Upvotes: 2

Related Questions