Hello!
I have a problem with mouse events on a TreeListCtrl in wxPython 2.8.1.1 (msw-unicode)
I use a TreeListCtrl with an assigned context menu, like this:
costMenu=wx.Menu()
costMenu.Append(ID_PRO_REFRESHCOSTS, "&aktualisieren","Liste neu laden")
...
s = wx.TR_FULL_ROW_HIGHLIGHT|wx.TR_MULTIPLE|wx.TR_DEFAULT_STYLE|wx.BORDER_SIMPLE
self.costview = wx.gizmos.TreeListCtrl(p, style=s)
self.costview.Bind(wx.EVT_CONTEXT_MENU, lambda event: common.popupMenu(event,costMenu))
...
This worked well with wxPython 2.6.3.xx (msw-unicode)
But with 2.8.1.1 the eventhandlermethod is never called.
Tried other mouse events too (eg RIGHT_DOWN), but the same.
Doing same thing on a ListCtrl works quite well with both Versions.
Hello!
I have a problem with mouse events on a TreeListCtrl in wxPython 2.8.1.1 (msw-unicode)
I use a TreeListCtrl with an assigned context menu, like this:
costMenu=wx.Menu()
costMenu.Append(ID_PRO_REFRESHCOSTS, "&aktualisieren","Liste neu laden")
...
s = wx.TR_FULL_ROW_HIGHLIGHT|wx.TR_MULTIPLE|wx.TR_DEFAULT_STYLE|wx.BORDER_SIMPLE
self.costview = wx.gizmos.TreeListCtrl(p, style=s)
self.costview.Bind(wx.EVT_CONTEXT_MENU, lambda event: common.popupMenu(event,costMenu))
...
This worked well with wxPython 2.6.3.xx (msw-unicode)
But with 2.8.1.1 the eventhandlermethod is never called.
Tried other mouse events too (eg RIGHT_DOWN), but the same.
Doing same thing on a ListCtrl works quite well with both Versions.
The TLC is consuming the right button events, so the OS assumes that it has been handled and doesn't turn it into a context menu event. You can instead use the EVT_TREE_ITEM_RIGHT_CLICK, or if you want to use the low level mouse events, you can bind them to the self.costview.GetMainWindow() window instead of directly to self.costview.
···
t.pompe@architekt-prinz.at wrote:
Hello!
I have a problem with mouse events on a TreeListCtrl in wxPython 2.8.1.1 (msw-unicode)
I use a TreeListCtrl with an assigned context menu, like this:
costMenu=wx.Menu()
costMenu.Append(ID_PRO_REFRESHCOSTS, "&aktualisieren","Liste neu laden")
...
s = wx.TR_FULL_ROW_HIGHLIGHT|wx.TR_MULTIPLE|wx.TR_DEFAULT_STYLE|wx.BORDER_SIMPLE
self.costview = wx.gizmos.TreeListCtrl(p, style=s)
self.costview.Bind(wx.EVT_CONTEXT_MENU, lambda event: common.popupMenu(event,costMenu))
...
This worked well with wxPython 2.6.3.xx (msw-unicode)
But with 2.8.1.1 the eventhandlermethod is never called.
Tried other mouse events too (eg RIGHT_DOWN), but the same.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!