question about wxpython CtrlList event binder: wx.EVT_LIST_ITEM_RIGHT_CLICK

Kent kent.yuan at gmail.com
Tue Apr 21 16:35:08 EDT 2009


Hi there,

I wrote a desktop application with wxPython2.8. And got a problem.
Hope here someone can give some hint. Thanks in advance.

There was a ListCtrl (lc) in my GUI, and it was a bit long, so that
there would be some blank space below ("empty area") in case there
were only a few items.

I bind a function on the event wx.EVT_LIST_ITEM_RIGHT_CLICK, when user
rightclick on the lc item, my function was triggered, and open a popup
menu.

Depends on the item user clicked, the menu items can be different. I
checked the event.getData(), to decide which menu item will show to
user. That is, if user right click on the "empty area", the
event.getData() will be 0. I wrote the appl. under Linux, and tested,
it worked as what I expected.

However, today someone reported a bug, said, under Windows XP, right
clicking on the items of lc, it works fine, but if on the "empty area"
of the lc, nothing happened, no popup menu. I tested under WINXP, the
function was not triggered at all when I right-clicked on the "empty
area".

I tried to bind wx.EVT_RIGHT_DOWN(UP) to the lc, but the function
cannot be triggered under Linux.  any suggestion?

Thanks

regards,

Kent





More information about the Python-list mailing list