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
<br>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.<br>
<br>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.<br>
<br>My general code for popup menus:<br><br>menu = wx.Menu()<br>.. add menu items using menu.Append<br>self.PopupMenu(menu)<br>menu.Destroy()<br><br>I've tried binding PopupMenu() to the frame containing the matplotlib canvas and also to the canvas itself.<br>
<br>any reason why PopupMenu() would hang?<br><br>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<br><br>using wxPython <a href="
http://2.8.8.0">2.8.8.0</a>, matlotlib 0.98.1, python 2.5.2, debian testing box<br>
<br>thanks,<br><br>Paul<br><br>
_______________________________________________
wxpython-users mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
On Sat, Jun 28, 2008 at 5:44 PM, Robin Dunn <[email protected]> wrote:
> Paul Hartley wrote:
>
> 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?
>>
>
> Does it happen anywhere besides with matplotlib windows?
>
>
>
I left this issue alone for a while, but got around to it today. For the
record, I think I fixed it by using wx.CallAfter() to bring up the menu -
things work as expected - get a menu every time I click instead of at some
random point. So I assume I had to let the matplotlib event handler go thru
all its motions first.
paul
<div dir="ltr"><br><div class="gmail_quote">On Sat, Jun 28, 2008 at 5:44 PM, Robin Dunn <<a href="mailto:robin@alldunn.com">robin@alldunn.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Paul Hartley wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
menu = wx.Menu()<br>
.. add menu items using menu.Append<br>
self.PopupMenu(menu)<br>
menu.Destroy()<br>
<br>
I've tried binding PopupMenu() to the frame containing the matplotlib canvas and also to the canvas itself.<br>
<br>
any reason why PopupMenu() would hang?<br>
</blockquote>
<br></div>
Does it happen anywhere besides with matplotlib windows?<br>
<br>
<br></blockquote></div><br>I left this issue alone for a while, but got around to it today. For the record, I think I fixed it by using wx.CallAfter() to bring up the menu - things work as expected - get a menu every time I click instead of at some random point. So I assume I had to let the matplotlib event handler go thru all its motions first.<br>
<br>paul<br></div>
_______________________________________________
wxpython-users mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users