Hi All,
I have an issue on Windows & Linux, Python 3.10.6 & wxpython 4.2.0. The problem did not exist with python 3.9.8 and wxpython 4.1.1.
I am using an UltimateListCtrl in virtual lit mode (I also use it elsewhere as a standard list and that’s working ok so this is related to VirtualLists. When running my code I get the following error which is not providing a lot of information for me to assist with debugging.
File “C:\Python310\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 12278, in OnSize
self.DoLayout()
File “C:\Python310\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 13653, in DoLayout
self.Layout()
TypeError: could not convert ‘Virtuallist’ to ‘TopLevelWindow’
It would be rather difficult to create some runnable code example as its quite a lot of code involved. Given I havent changed anything myself between python & wx releases I’m not sure where to go with this one.
[UPDATED] I found the cause of the above. In the class declaration for the virtual list, I was passing an instance of the MainFrame class. I thought this was the right way to gain access to class methods from that class. Up until now this has never thrown an error. Now it does. Turns out it wasnt needed as when I deleted the main class link all was well.
Went from:
class VirtualList(ulc.UltimateListCtrl, MainForm):
to:
class VirtualList(ulc.UltimateListCtrl):
Any suggestions?