Skip to content Skip to sidebar Skip to footer

Python: Right Click On List Menu Not Showing Item Selected

In my ongoing effort to learn more about python, I am trying to add a right click event to my mp3 manager program. What currently works is that it shows the menu and all of the op

Solution 1:

Maybe you should use event.GetString() in place of event.GetText()

See here

Your code seems outdated tho, binding to events should be done like this:

menu.Bind(wx.EVT_MENU, self.MenuSelectionCb, id=id)

moreover if you bind all ids to the same function you can just bind once for all ids:

menu.Bind(wx.EVT_MENU, self.MenuSelectionCb)

Solution 2:

You can find a solution under Python: Right click on objectlistview not showing item name selected where the use of objectlistview's GetSelectedObject() method is proposed instead.

Post a Comment for "Python: Right Click On List Menu Not Showing Item Selected"