Propogate wx.Frame Menu Shortcuts to wx.MiniFrame

Erik Tollerud wrote:

I have an application with a main wx.Frame with a menu bar that
includes the handy automatic menu shortcuts (e.g. the menu item text
is of the form 'item \t Alt+I' or the like). The application also has
some wx.MiniFrame s that are used as floating toolbars.

The problem is, I would like the menu shortcuts to work when the
miniframes have focus, and they don't (they only seem to process
regular key events). Does anyone know how I can convince the
miniframes to respond to the appropriate menu shortcut keystrokes
(aside from hand-coding each of the keyboard events, and unelegant
solution at best).

I tried doing something like
miniframe.SetAcceleratorTable(mainframe.GetAcceleratorTable()) , but
that didn't seem to do anything... I admit I don't really understand
how the automatic MenuBar shortcuts work, though (are they key events,
accelerator tables, or something else?)... event just a hint as to
what's happening under the hood might point me in the right
direction...

They are handled the same as an accelerator table, but I think they are kept separate, which is why your mainframe.GetAcceleratorTable() didn't help. You'll probably need to duplicate the menu accelerators in a new accelerator table assigned to the miniframe.

ยทยทยท

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