I have an issue in an application I’m developing, and I’ll try to create a standalone script of the issue (won’t be easy), but I thought I’d describe the issue here to see if something sounds familiar. I have a matplotlib canvas with two matplotlib events programmed to bring up popup menus. In general, I have no problems bringing up the menu and running something off the menu. However, often I have to click several times to bring up the menu, and my traces show that for every click, the code goes as far as wx.PopupMenu() and seems to hang up somewhere in the execution of wx.PopupMenu.
A second issue is that I have two different popup menus that are brought up. One popup is brought up by a right-click, and the other is by the matplotlib selector widget. If I can bring up a popup with a right-click and select a menu item, and then use the selector widget to bring up the second popup menu, I cannot ever bring up that menu, and again, the code executes as far as wx.PopupMenu and seems to get hung up somewhere in that execution.
My general code for popup menus:
menu = wx.Menu()
… add menu items using menu.Append
self.PopupMenu(menu)
menu.Destroy()
I’ve tried binding PopupMenu() to the frame containing the matplotlib canvas and also to the canvas itself.
any reason why PopupMenu() would hang?
for what it’s worth, if wx.PopupMenu hangs, and I close down the application, I can’t get a cursor at the terminal window
using wxPython 2.8.8.0, matlotlib 0.98.1, python 2.5.2, debian testing box
thanks,
Paul