Is there anything like a wxPushButton?

Carsten A. Arnholm arnholm at offline.no
Fri Nov 23 04:15:10 PST 2007


Paul Evrard wrote:
> Hi again,
>
> Sorry my paragraph about mouse capture is not clear. Please read:
>
> You can also use the CaptureMouse method of class wxWindow
> (http://wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowcapturemouse)
> ***so that*** even if you move the mouse out of the
> button, your PushButton class will still get the mouse input. It may
> be
> necessary to capture the button release event of your mouse (of that I
> am not sure...).

Thanks for the input Paul,

Some of what you say may indeed become useful. I will study it. But maybe my 
description was not sufficiently clear. I need a button that mimicks a 
physical button with a spring, like a door-bell button if you like: it 
simply rings as long as you push it. I deliberatly simplified the 
description, but the truth is that there are more than one such button, and 
each one has its own motor to control.  Therefore capturing the mouse 
outside the button seems like the wrong approach.

It appears that if no existing button exists for this purpose, maybe your 
idea of deriving a wxPushButton from wxButton is the right thing to try. 
Remember I also wanted the button to use a highlighted colour when in 
pressed state. It is going to take me some time to figure this out though.

Any additional input most welcome.

-- 
Carsten A. Arnholm
http://arnholm.org/
N59.776 E10.457









More information about the wx-users mailing list