I am working on wxPython 2.9.5 (msw) and try to detect when the column separators are/have been dragged. Thereby I noticed that some DataViewCtrl events do not work. Binding standard events on the DVC like EVT_LEFT_DOWN does not work either.
self.dvc is a DataViewCtrl
does work
self.dvc.Bind(dv.EVT_DATAVIEW_COLUMN_HEADER_CLICK, self.on_colheaderclick)
do all not work
parent.GetParent() == wx.Frame
self.dvc.Bind(dv.EVT_DATAVIEW_COLUMN_REORDERED, self.on_colheaderclick)
self.dvc.Bind(wx.EVT_LEFT_DOWN, self.on_colheaderclick)
parent.GetParent().Bind(wx.EVT_RIGHT_DOWN, self.on_colheaderclick, source=self.dvc)
self.dvc.Bind(dv.EVT_DATAVIEW_COLUMN_HEADER_CLICK, self.on_colheaderclick)
self.dvc.Bind(dv.EVT_DATAVIEW_COLUMN_REORDERED, self.on_colheaderclick)
Bug or feature?
Is maybe the binding incorrect?
With thanks in advance
I am working on wxPython 2.9.5 (msw) and try to detect when the column separators are/have been dragged. Thereby I noticed that some DataViewCtrl events do not work. Binding standard events on the DVC like EVT_LEFT_DOWN does not work either.
self.dvc is a DataViewCtrl
does work
self.dvc.Bind(dv.EVT_DATAVIEW_COLUMN_HEADER_CLICK, self.on_colheaderclick)
do all not work
parent.GetParent() == wx.Frame
self.dvc.Bind(dv.EVT_DATAVIEW_COLUMN_REORDERED, self.on_colheaderclick)
self.dvc.Bind(wx.EVT_LEFT_DOWN, self.on_colheaderclick)
parent.GetParent().Bind(wx.EVT_RIGHT_DOWN, self.on_colheaderclick, source=self.dvc)
self.dvc.Bind(dv.EVT_DATAVIEW_COLUMN_HEADER_CLICK, self.on_colheaderclick)
self.dvc.Bind(dv.EVT_DATAVIEW_COLUMN_REORDERED, self.on_colheaderclick)
Bug or feature?
Is maybe the binding incorrect?
With thanks in advance
Can’t you use EVT_DATAVIEW_COLUMN_HEADER_CLICK? You say it works. I’d think you would have saved the column widths, then in the on_colheaderclick function, check to see if the width is different.
···
On Tuesday, July 1, 2014 7:56:20 AM UTC-7, nepix32 wrote:
Yes, this was my first thought also. I included it to show that some events for the header columns fire, others not.
Unfortunately EVT_DATAVIEW_COLUMN_HEADER_CLICK does fire only when clicking on the column header field (starting sorting at the same time, which is not what I want). The event does not fire when clicking/dragging the separator between column header fields.
I “worked” around the issue by reading back the column widths when closing the parenting wx.Frame, so for me this issue is solved.
However some events are still not working so I hoped maybe someone could point out to me that the binding was wrong or something the like.
Thanks
···
On Tuesday, July 8, 2014 2:56:50 AM UTC+2, Nathan McCorkle wrote:
Can’t you use EVT_DATAVIEW_COLUMN_HEADER_CLICK? You say it works. I’d think you would have saved the column widths, then in the on_colheaderclick function, check to see if the width is different.