System info:
Fedora 34 (x86_64) running Wayland
Python 3.9
wxPython 4.1.1
Hi,
I discovered a strange behavior in the ListCtrl. When it is set to use check boxes, scrolling begins to lag if and only if the boxes are ticked.
Here is a minimal example.
Run it with self._list_ctrl.CheckItem(0, True)
and do a quick drawn out scroll in the list, it will lag and jump to the final position but only if you scroll quickly. (This is easy to do on a touch pad).
Run it with self._list_ctrl.CheckItem(0, False)
and no matter how quickly you scroll, it will keep up.
Is this a know bug, has anyone encountered this and can I somehow work around this?
Thanks.
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'List ctrl example', size=(200, 200))
self._list_ctrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT | wx.LC_SINGLE_SEL)
self._list_ctrl.InsertColumn(0, 'Data', format=wx.LIST_FORMAT_LEFT)
self._list_ctrl.SetColumnWidth(0, 200)
self._list_ctrl.EnableCheckBoxes()
for i in range(0, 200):
self._list_ctrl.InsertItem(0, 'item: ' + str(i))
# Scrolling is slow because of checked checkboxes, unchecked boxes are ok.
self._list_ctrl.CheckItem(0, True)
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame()
frame.Show(True)
return True
if __name__ == '__main__':
app = MyApp(False)
app.MainLoop()