Bitmap Toggle Button

Has anyone any experience with a bitmap toggle button?

I can do a bitmap button and a toggle button, but not a toggle button
that displays a bitmap.

I am not even sure if I am approaching this correctly...

What I want to do is have a record button that when clicked, changes to
a stop button, linked to a different binding that stops recording.

Is that possible? If so, do I use a toggle button or destroy the button
and replace it?

Any ideas?

I know that in pyGTK you could do this with onButtonDown and onButtonUp
events. Is this possible in wxPython too?

--Paul

···

--
------------------------------------------------------------.

Chisimba PHP5 Framework - http://avoir.uwc.ac.za |

:------------------------------------------------------------:

Hi Paul,

Has anyone any experience with a bitmap toggle button?

I can do a bitmap button and a toggle button, but not a toggle button
that displays a bitmap.

I am not even sure if I am approaching this correctly...

What I want to do is have a record button that when clicked, changes to
a stop button, linked to a different binding that stops recording.

Is that possible? If so, do I use a toggle button or destroy the button
and replace it?

Any ideas?

I know that in pyGTK you could do this with onButtonDown and onButtonUp
events. Is this possible in wxPython too?

--Paul
  
According to Robin's book, the ToggleButton is inheriting from the wx.Button, with the main difference being that the ToggleButton sends EVT_TOGGLEBUTTON. You could use a sentinel value to tell when it's been toggled.

Of course, it looks like it would be easier to just use the generic buttons. See the demo. It has a generic toggle button with a bitmap of a lightbulb.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

Got it, thanks! The demo came through again!

I now have a very pretty toggle button working.

--Paul

···

On Thu, 2008-08-28 at 14:37 -0500, Mike Driscoll wrote:

Of course, it looks like it would be easier to just use the generic
buttons. See the demo. It has a generic toggle button with a bitmap of a
lightbulb.

And, of course thank you Mike... (blush)

--Paul

···

On Thu, 2008-08-28 at 22:07 +0200, Paul Scott wrote:

Got it, thanks! The demo came through again!

I now have a very pretty toggle button working.