wxTextCtrl and handling button down even in OnChar()

Steve Holden sholden at holdenweb.com
Wed Feb 13 12:29:07 EST 2002


"Doug Farrell" <writeson at earthlink.net> wrote in message
news:88bc63c6.0202130907.31a13d52 at posting.google.com...
> Hi,
>
> I've written an application that has a control I've derived from
> wxButton so I can provide my own EVT_BUTTON(self, ID, self.OnClick)
> event handling. In the method OnClick() I'm getting the button press,
> but I see both the button down and button up events, which causes my
> code to run twice. I'd like to filter the button press and only react
> to the button down event. The trouble is, I can't seem to find the
> method of event or whatever that will allow me to do this. If any one
> has some ideas how I can process only moust button down events, I'd
> really appreciate it.
>
Doug:

I'm sure the wxHeads will reply giving you the answer you seek, this is just
a cautionary point about user interfaces in general -- it may not apply in
the specific case you have in mind.

If you are going to choose a single event to action on a button, it's better
to use the button UP rather than button Down event. There's nothing worse
than an interface that won't let you change your mind, so that a little
unintentional extra pressure on the mouse button is all you need for
disaster. On the better (more "comfortable") user interfaces you should find
you can click on a button then change your mind, and move the cursor off the
button before releasing the mouse button, without selecting any action.

still-looking-for-dwim-mode-ly y'rs  - steve
--
Consulting, training, speaking: http://www.holdenweb.com/
Author, Python Web Programming: http://pydish.holdenweb.com/pwp/

"This is Python.  We don't care much about theory, except where it
intersects with useful practice."  Aahz Maruch on c.l.py







More information about the Python-list mailing list