i got some errors with this code i cant make the popup
import wx
import wx.lib.agw.flatmenu as fmenu
class Form(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title)
self.menubar = wx.MenuBar()
self.menu_a = wx.Menu()
self.menu_a.Append(-1, "&Cerrar\tCtrl+Q", "yo")
self.menubar.Append(self.menu_a, "&Archivo")
self.SetMenuBar(self.menubar)
self.CreateStatusBar()
self.panel = wx.Panel(self, -1)
self.Bind(wx.EVT_CONTEXT_MENU, self.onPopUp)
#popupmenu
self.pmenu = fmenu.FlatMenu()
self.pmenu.Append(-1, "menu1\tCtrl + A", "", None)
self.pmenu.Append(-1, "menu1", "", None)
self.pmenu.Append(-1, "menu1", "", None)
self.pmenu.Append(-1, "menu1", "", None)
self.pmenu.Append(-1, "menu1", "", None)
def onPopUp(self, event):
pos = event.GetPosition()
pos = self.panel.ScreenToClient(pos)
self.pmenu.Popup( pos, None, self.panel)
app = wx.App()
Form(None, -1, "menu").Show()
app.MainLoop()