import
wx
class
Example(wx.Frame):
def
__init__(
self
,
*
args,
*
*
kw):
super
(Example,
self
).__init__(
*
args,
*
*
kw)
menubar
=
wx.MenuBar()
fm1
=
wx.Menu()
fileitem
=
fm1.Append(
20
,
"one"
)
fm2
=
wx.Menu()
fileitem2
=
fm2.Append(
21
,
"two"
)
menubar.Append(fm1,
'&Menu_one'
)
menubar.Append(fm2,
'&Menu_two'
)
self
.SetMenuBar(menubar)
self
.SetSize((
300
,
200
))
self
.SetTitle(
'Menu Bar'
)
pnl
=
wx.Panel(
self
)
vbox
=
wx.BoxSizer(wx.VERTICAL)
font
=
wx.Font(
13
, wx.DEFAULT, wx.NORMAL, wx.DEFAULT)
st1
=
wx.StaticText(pnl, label
=
menubar.GetLabel(
20
), style
=
wx.ALIGN_LEFT)
st2
=
wx.StaticText(pnl, label
=
menubar.GetLabel(
21
), style
=
wx.ALIGN_LEFT)
st1.SetFont(font)
st2.SetFont(font)
vbox.Add(st1, flag
=
wx.
ALL
, border
=
15
)
vbox.Add(st2, flag
=
wx.
ALL
, border
=
15
)
pnl.SetSizer(vbox)
def
main():
app
=
wx.App()
ex
=
Example(
None
)
ex.Show()
app.MainLoop()