Missing Events of TreeListCtrl after upgrade from wxPython 2.6.3 to 2.8.1.1

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.

Thanks for any tips to solve the problem!
TP

Hi TP,

···

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.

Doing same thing on a ListCtrl works quite well with both Versions.
  

I think you need to use GetMainWindow, e.g.:

self.costview.GetMainWindow().Bind(wx.EVT_LEFT_UP, self.OnLeftUp)

Werner

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!