Hi all,
I'm trying to make a relocatable popup menu. By this I mean that I want
to have a popup menu that can be popped up from various other windows,
not just one. At first this seemed like it would be easy: I just create
a custom menu class, then crete it an pop it up wherever I need it,
However, after looking at the demo, and after a recent discussion here
about binding menus, this looks like it can't be done.
Apparently, menu events are not delivered to the menu, but rather to the
window that hosts it. they are then bound to method in that window:
self.Bind(wx.EVT_MENU, self.OnPopupOne, id=self.popupID1)
where self is a panel, in this case (from the demo). However, in my
case, I want the menu event to do the saem thing, regardless of what
window I poped it up in. Is there any way to do that? or do I need to
either:
1) duplicate the menu code in every window I want the popup to occur in.
or
2) forget using menues, and build something similar myself with a popup
window.
Are there any other options?
-Chris