I'm developing an application that contains a number of panes. See the screenshot:
wx.ScrolledPanel
that contains a number of wx.Panels
.wx.grid.Grid
.wx.Panel
that contains a wx.grid.Grid
.wx.Panel
containing an enthought chaco plot.wx.Panel
.I would like to implement focus follows mouse so that when I move my mouse over the plot I can immediately zoom in or out using my scroll wheel without first clicking on the plot to give it the focus.
Similarly when I move my mouse over the left settings , the top events or the bottom data panes I would like to be able to immediately scroll the window using the scroll wheel without first clicking on the window.
Currently I defined a function:
def focusFollowsMouse(window):
window.Bind(wx.EVT_ENTER_WINDOW, lambda event: window.SetFocus())
I would like to apply this function only on the four top-level panes: plot, settings, events and data.
However I need to call this function for each sub-panel or control in each of the top-level panes to get this to work. For example I need to apply this function individually to the Measurement Settings, Analysis Parameters, View Settings etc. panels.
Most likely the EVT_ENTER_WINDOW
event is not propagated to parent windows.
Is there a way to get this to work without applying focusFollowsMouse
to each and every sub-panel or control?
Thanks
This is Windows' behaviour - it works as you expect under GTK. Personally, I'd leave your app as it is, for consistency with other Windows applications, and install WizMouse
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With