WxPython, nested panels and accelerators

The wxPython accelerators don't seem to work with nested panels. In other words:

    -----------------------------------------------
    | Main panel |
    | ----------------- ----------------- |
    | | Subpanel 1 | | Subpanel 2 | |
    | | accelerator | | accelerator | |
    | | key for 'a' | | key for 'b' | |
    | ----------------- ----------------- |
    -----------------------------------------------

When a control in subview 1 has focus, I want Alt + b to still invoke control in subview 2, which uses b as the accelerator key. How to do it?

If it matters, I load the panel using xrc into a plain old wx.Frame.

+2


source to share


1 answer


If the main panel has an accelerator table with Alt + b, this should work. Maybe the subviews have their own accelerator tables that contradict each other? You can try to inactivate them with the help subpanel.SetAcceleratorTable(wx.NullAcceleratorTable)

for each subview.



0


source







All Articles