wxTextCtrl and handling button down even in OnChar()

Doug Farrell writeson at earthlink.net
Thu Feb 14 12:49:46 EST 2002


Steve,

Thanks for the advice, a good idea that I will implement. 

And you're right, the wxHeads did help me out. The problem was that I
had an event.Skip() call in my event handler, so the event wasn't
'eaten' by my event handler and got handled by the default handler as
well. Essentially causing a button to look like it was hit twice.

Thanks again,
Doug

"Steve Holden" <sholden at holdenweb.com> wrote in message news:<ynxa8.209099$KM2.8640420 at atlpnn01.usenetserver.com>...
> "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



More information about the Python-list mailing list