Customtreectrl under Ubuntu ?

hello,

I'm totally unfamiliar with Ubuntu (and other Linux distros).
Today I installed Ubuntu in a xVM Virtualbox under winXP.
The Ubuntu installation already contained wxPython:
wx.version()
'2.8.7.1 (gtk2-unicode)'

Now none of my programs works correctly.
One of the main problems is that I frequently use right mouse popup on the customtreectrl.
Making a small program with only a customtreectrl revealed the problem:
These are the bindings
    self.Tree.Bind ( wx.EVT_RIGHT_DOWN, self.OnRightDown )
    self.Tree.Bind ( wx.EVT_CONTEXT_MENU, self.OnShowPopup )

Under winXP,
right mouse click generates both events

Under Ubuntu, only the Right_Down event
and not the Context_Menu event.

Now I want to look for Customctlr.py,
but I can't find it under Ubuntu.

Where can I find that file ?

Is this a bug in CustomTreeCtrl ?

Is there a workaround ?
(Maybe I could bind all actions needed to the Right_Down event ?)

thanks,
Stef Mientki

Hi Stef,

hello,

I'm totally unfamiliar with Ubuntu (and other Linux distros).
Today I installed Ubuntu in a xVM Virtualbox under winXP.
The Ubuntu installation already contained wxPython:
wx.version()
'2.8.7.1 (gtk2-unicode)'

Now none of my programs works correctly.
One of the main problems is that I frequently use right mouse popup on the
customtreectrl.
Making a small program with only a customtreectrl revealed the problem:
These are the bindings
  self.Tree.Bind ( wx.EVT_RIGHT_DOWN, self.OnRightDown )
  self.Tree.Bind ( wx.EVT_CONTEXT_MENU, self.OnShowPopup )

Under winXP,
right mouse click generates both events

Under Ubuntu, only the Right_Down event
and not the Context_Menu event.

I am not sure where the problem may be, in the source code I do not
Bind() or intercept the wx.EVT_CONTEXT_MENU event, so it shouldn't be
blocked. In any case, are you binding these 2 events when a user
right-clicks on a tree item or because you want these events to be
called also in an empty tree (i.e., no tree items in it)? If you are
binding these events for right-clicks on tree items, you should really
use wx.EVT_TREE_ITEM_RIGHT_CLICK as event.

Now I want to look for Customctlr.py,
but I can't find it under Ubuntu.

Where can I find that file ?

The file should live under
/usr/lib/python2.5/site-packages/wx-2.8-gtk-unicode/wx/lib, or
something similar (I don't have my VM with me).

Is this a bug in CustomTreeCtrl ?

Maybe, or maybe is just that wx.PyScrolledWindow does not react to
wx.EVT_CONTEXT_MENU on GTK.

Is there a workaround ?
(Maybe I could bind all actions needed to the Right_Down event ?)

Possibly, but see my question above.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Sat, Oct 4, 2008 at 8:36 PM, Stef Mientki wrote:

hi Andrea,

well this problem is of a long time ago,
I then didn't got it working, so I used a workaround.
I finally found the time to solve the problem ..

Andrea Gavana wrote:

Hi Stef,

hello,

I'm totally unfamiliar with Ubuntu (and other Linux distros).
Today I installed Ubuntu in a xVM Virtualbox under winXP.
The Ubuntu installation already contained wxPython:
wx.version()
'2.8.7.1 (gtk2-unicode)'

Now none of my programs works correctly.
One of the main problems is that I frequently use right mouse popup on the
customtreectrl.
Making a small program with only a customtreectrl revealed the problem:
These are the bindings
  self.Tree.Bind ( wx.EVT_RIGHT_DOWN, self.OnRightDown )
  self.Tree.Bind ( wx.EVT_CONTEXT_MENU, self.OnShowPopup )

Under winXP,
right mouse click generates both events

Under Ubuntu, only the Right_Down event
and not the Context_Menu event.
    
I am not sure where the problem may be, in the source code I do not
Bind() or intercept the wx.EVT_CONTEXT_MENU event, so it shouldn't be
blocked. In any case, are you binding these 2 events when a user
right-clicks on a tree item or because you want these events to be
called also in an empty tree (i.e., no tree items in it)? If you are
binding these events for right-clicks on tree items, you should really
use wx.EVT_TREE_ITEM_RIGHT_CLICK as event.

That didn't work, so I stopped searching.
Refactoring my code, I found the problem:
the wx.EVT_TREE_ITEM_RIGHT_CLICK seems to work better, also under windows.
But the problem lies in the double binding,
  wx.EVT_RIGHT_DOWN and wx.EVT_TREE_ITEM_RIGHT_CLICK
under windows this doesn't seem to be a problem,
but under Ubuntu it causes never to fire the wx.EVT_TREE_ITEM_RIGHT_CLICK event.

thanks,
cheers,
Stef

···

On Sat, Oct 4, 2008 at 8:36 PM, Stef Mientki wrote: