It depends on platform, they have different native behaviors for the
wheel events. On Windows the wheel events are only sent to the widget
that has the focus. If you are on Windows then I guess that in this
case the native textctrl is passing them up to the parent.
On the other platforms the wheel events are sent to whichever widget the
mouse pointer is positioned over, (possibly even if that app is not in
the foreground.) So for scrolled panels you should be able to get the
wheel events if you position the pointer over some part of the scrolled
panel that is not covered by a child widget.
--
Robin Dunn
Software Craftsman
http://wxPython.org
It depends on platform, they have different native behaviors for the
wheel events. On Windows the wheel events are only sent to the widget
that has the focus. If you are on Windows then I guess that in this
case the native textctrl is passing them up to the parent.
On the other platforms the wheel events are sent to whichever widget the
mouse pointer is positioned over, (possibly even if that app is not in
the foreground.) So for scrolled panels you should be able to get the
wheel events if you position the pointer over some part of the scrolled
panel that is not covered by a child widget.
--
Robin Dunn
Because it derives from wx.Panel which has code that when it receives
the focus will try to reset the focus to its first child that will take
the focus. This is needed to make the tab-traversal work when there are
nested panels, panels in things like splitters or notebooks, etc..
> Do I need to subclass ScrolledPanel into something that takes focus more
> aggressively? Or is there a simpler solution built into wxPython?
The best thing to do, if possible, is to not have any child widgets on
the scrolled window. For example, instead of having a StaticBitmap
widget you can draw the bitmap yourself directly on the scrolled window.
Otherwise, I don't think that all of the focus handling and tab
traversal of wx.Panel/wx.ScrolledWindow can be overridden... Perhaps
instead you could add scrollability to wx.Window yourself without that
focus and navigation functionality.