Operating system: Windows 10
wxPython version & source: 4.1.0 and 4.1.1 PyPI
Python version & source: 3.8.3 installer downloaded from Python website
Description:
The Phoenix migation guide has the following about wx.ListCtrl:
“In wx.ListItem and wx.ListEvent the “m_” properties are no longer public. Instead use the associated getter/setter methods or the auto-generated properties that are using them.”
When sending a wx.ListEvent though (for EVT_COMMAND_LIST_COL_DRAGGING, EVT_COMMAND_LIST_COL_BEGIN_DRAG, EVT_COMMAND_LIST_COL_END_DRAG or EVT_COMMAND_LIST_COL_CLICK), wx.lib.agw.hypertreelist.HyperTreeList still sets m_pointDrag and m_col. Presumably these settings should be replaced with calls to evt.SetColumn(…) and evt.SetPoint(…)? This causes a problem where evt.GetColumn() does not return the correct event column index (for me it returns 0 or -1), while using evt.m_col does.
To test with the code below for a small sample app, drag different column headers to resize the columns; the values of event.GetColumn() and event.m_col will be reported.
#!/usr/bin/env python
""" Test app """
import wx
import wx.lib.agw.hypertreelist as HTL
class MainFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY)
# Contains a HyperTreeList
tree = HTL.HyperTreeList(self, wx.ID_ANY)
for icol in range(4):
tree.AddColumn(f"Column {icol}")
tree.SetMainColumn(0)
root = tree.AddRoot("The root item")
tree.Bind(wx.EVT_LIST_COL_END_DRAG, self.OnColResize)
def OnColResize(self, evt):
try:
print("event.GetColumn() = ", evt.GetColumn())
except AttributeError:
print("event has no GetColumn method")
try:
print("event.m_col = ", evt.m_col)
except AttributeError:
print("event has no m_col property")
print("")
# Application loop
print(wx.version())
app = wx.App(False)
mainwin = MainFrame()
mainwin.Show(True)
app.MainLoop()
Operating system: Windows 10 wxPython version & source: 4.1.0 and 4.1.1 PyPI Python version & source: 3.8.3 installer downloaded from Python website
Description: The Phoenix migation guide has the following about wx.ListCtrl: “In wx.ListItem and wx.ListEvent the “m_” properties are no longer public. Instead use the associated getter/setter methods or the auto-generated properties that are using them.”
When sending a wx.ListEvent though (for EVT_COMMAND_LIST_COL_DRAGGING, EVT_COMMAND_LIST_COL_BEGIN_DRAG, EVT_COMMAND_LIST_COL_END_DRAG or EVT_COMMAND_LIST_COL_CLICK), wx.lib.agw.hypertreelist.HyperTreeList still sets m_pointDrag and m_col. Presumably these settings should be replaced with calls to evt.SetColumn(…) and evt.SetPoint(…)? This causes a problem where evt.GetColumn() does not return the correct event column index (for me it returns 0 or -1), while using evt.m_col does.
To test with the code below for a small sample app, drag different column headers to resize the columns; the values of event.GetColumn() and event.m_col will be reported.