I would like to intercept the escape key in a wxTextCtrl so that
users could abandon changes and revert to a previous (validated)
value. How do I do that? I tried using EVT_CHAR, but that doesn't
seem to do anything with a text control...
Thanks in advance.
···
-------------------------------------------------------------------------------------
Jeff Kotula Systems Architecture Manager
Vital Images jkotula@vitalimages.com
Renunciation is not giving up the things of this world,
but accepting that they go away.
-- Suzuki Roshi
I would like to intercept the escape key in a wxTextCtrl so that
users could abandon changes and revert to a previous (validated)
value. How do I do that? I tried using EVT_CHAR, but that doesn't
seem to do anything with a text control...
Try with EVT_KEY_DOWN. EVT_CHAR occurs after the key has been "translated" by the default key event handlers. If you want to intercept a key event before a controll processes it then usually EVT_CHAR is too late.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Tiago Duarte Felix wrote:
> Is it possible to use images instead of text in wxChoice?
>
>
Not with any of the standard controls, but creating a custom control for
this wouldn't be too hard.
How can i create a custom control of that kind... just need an idea of how
to do it... never done anything of that king....
···
----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Friday, November 15, 2002 2:22 AM
Subject: Re: [wxPython-users] Is it possible to use images instead of text
Is it possible to use images instead of text in wxChoice?
Not with any of the standard controls, but creating a custom control for
this wouldn't be too hard.
How can i create a custom control of that kind... just need an idea of how
to do it... never done anything of that king....
Take a look at wxPython/lib/buttons.py for starters. Just derive a class from wxControl, put a wxScrolledWindow on it (or manage the scrollbar yourself directly on the wxControl) and then hook the mouse events and the EVT_PAINT event. In the paint handler draw your images, including any that are "selected" In the mouse handlers change the state of selected items as needed and redraw the affected items.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!