I looked at the demo.py and at the wiki, but I can't find a solution
to make shortcuts for buttons. In menu items you can do it with
"&foo", but how do I get something like this for buttons? I would like
an application where I can control everything without a mouse.
One solution is to use an eventhandler, but how do I underline
characters in buttons, so that the user knows which shortcuts are
available?
I looked at the demo.py and at the wiki, but I can't find a solution
to make shortcuts for buttons. In menu items you can do it with
"&foo", but how do I get something like this for buttons? I would like
an application where I can control everything without a mouse.
One solution is to use an eventhandler, but how do I underline
characters in buttons, so that the user knows which shortcuts are
available?
On wxMSW you can still use the & in button's label and it draws the
underline and also takes care of capturing the Alt-key and turning it into a
EVT_BUTTON. I don't think that is supported with wxGTK, but you can at
least use a wxAcceleratorTable to define the keys that should be turned into
events.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
On Tue, Apr 23, 2002 at 03:02:13PM -0700, Robin Dunn wrote:
> I looked at the demo.py and at the wiki, but I can't find a solution
> to make shortcuts for buttons. In menu items you can do it with
> "&foo", but how do I get something like this for buttons? I would like
> an application where I can control everything without a mouse.
>
> One solution is to use an eventhandler, but how do I underline
> characters in buttons, so that the user knows which shortcuts are
> available?
On wxMSW you can still use the & in button's label and it draws the
underline and also takes care of capturing the Alt-key and turning it into a
EVT_BUTTON. I don't think that is supported with wxGTK, but you can at
least use a wxAcceleratorTable to define the keys that should be turned into
events.
EVT_CHAR events go only to the window that has the keyboard focus, and do
not travel up the parental heirarchy.
2. Who can I underline a character in a button?
If the native widget doesn't handle by putting the '&' in the label then
you'll have to either draw it yourself in an idle handler, or use custom
buttons where you draw everything.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
\