[wxPython] key shortcut and toolbar

hi,

I would like to associate shortcut key to button of toolbar.

But if i use EVT_CHAR on the window, i never receive anything because the
key are grab by the textcontrols of the windows...normal...

So i have to use a EVT_CHAR for each textcontrol and give back the
shortcut key to the parent windows... I don't like it, is there a better
way ?

bye

···

--
William Dodé - Informaticien Indépendant
http://www.flibuste.net

William Dode wrote:

hi,

I would like to associate shortcut key to button of toolbar.

But if i use EVT_CHAR on the window, i never receive anything because the
key are grab by the textcontrols of the windows...normal...

EVT_CHAR is only sent to windows that currently have the keyboard focus.
Buttons will only have the focus right after being pressed. What you want to
look at is wxAccelerators.

Jeff Shannon
Technician/Programmer
Credit International

I would like to associate shortcut key to button of toolbar.

But if i use EVT_CHAR on the window, i never receive anything because the
key are grab by the textcontrols of the windows...normal...

So i have to use a EVT_CHAR for each textcontrol and give back the
shortcut key to the parent windows... I don't like it, is there a better
way ?

Use a wxAcceleratorTable.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Le Mon, 13 May 2002 11:11:17 -0700
"Jeff Shannon" <jeff@ccvcorp.com> écrivait:

William Dode wrote:

> hi,
>
> I would like to associate shortcut key to button of toolbar.
>
> But if i use EVT_CHAR on the window, i never receive anything because
> the key are grab by the textcontrols of the windows...normal...

EVT_CHAR is only sent to windows that currently have the keyboard focus.
Buttons will only have the focus right after being pressed. What you
want to look at is wxAccelerators.

thanks, the name was not evident for me

bye

···

Jeff Shannon
Technician/Programmer
Credit International

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

--
William Dodé - Informaticien Indépendant
http://www.flibuste.net