How to make TreeListCtrl scroll with thumwheel

I have a gizmos TreeListCtrl in a ScrolledWindow with scroll bars. Although the TreeListCtrl moves up and down properly under the control of the scroll bar it does not move with the trackball thumbwheel.

What essential machinery do I need to capture thumbwheel movements for the TreeListCtrl?

Thanks in advance!

Hi,

The wx.lib.gizmos.TreeListCtrl consists of two windows (_header_win and _main_win), both of which grab the mouse events. First, check if the event is coming e.g.,

    #  obj is your TreeListCtrl object
    obj._main_win.Bind(wx.EVT_MOUSEWHEEL, ...)

Then, check the value of the event.WheelRotation and event.WheelAxis.
I don’t have a thumbwheel device so I am not sure this can be a help.

2 Likes

Thank you! I will try this ASAP and let the group know for future reference.

Works! (And now I wonder how I failed to find this; I definitely looked long enough.)