Code: Alles auswählen
import wx
class MainFrame(wx.Frame):
def __init__(self, parent, id):
wx.Frame.__init__(self, parent, id, "hallo")
menubar = wx.MenuBar()
self.SetMenuBar(menubar)
menu = wx.Menu()
menu.Append(-1, "Hallo")
menubar.Append(menu, "File")
self.Show(True)
print self.GetMenuBar().FindMenuItem("File", "&Hallo")
print self.GetMenuBar().FindMenuItem("File", "Hallo")
app = wx.PySimpleApp()
MainFrame(None, -1)
app.MainLoop()
Code: Alles auswählen
100
100
Code: Alles auswählen
menu.Append(-1, "&Hallo")
Code: Alles auswählen
-1
-1
Systeminfo:
Code: Alles auswählen
Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.__version__
'2.8.7.1'