How to bind scrollbar bottom in wxPython ListCtrl

时间:2016-04-25 09:46:26

标签: wxpython

I'm a beginner in wxPython but I don't figure out how to bind one event.

I want to bind this "EVT_SCROLL_BOTTOM" from a ListCtrl...

From the documentation it seems there is no way to do it. ListCtrl doesn't inherit ScrollEvent.. But is there a way to workaroud?

How to bind an event from vertical ScrollBar in ListCtrl?

Should I create my own ListCtrl Class and add ScrollEvent inheritance?

Best regards,

1 个答案:

答案 0 :(得分:2)

如上所述:wx.ScrollEvent documentation,ScrollEvents仅由独立滚动条和滑块发出。

然而,滚动Windows(例如wx.ListCtrl)会发出wx.ScrollWinEvents

因此,为了获得所需的结果,您应该将wx.EVT_SCROLLWIN_BOTTOM绑定到List Ctrl,如下所示:

ListCtrlVariable.Bind(wx.EVT_SCROLLWIN_BOTTOM, self.FooEventHandler)