]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-10/fancy_items.py
3 class MyFrame(wx
.Frame
):
5 wx
.Frame
.__init
__(self
, None, -1,
6 "Fancier Menu Example")
10 bmp
= wx
.Bitmap("open.png", wx
.BITMAP_TYPE_PNG
)
11 item
= wx
.MenuItem(menu
, -1, "Has Open Bitmap")
15 if True or 'wxMSW' in wx
.PlatformInfo
:
16 font
= wx
.SystemSettings
.GetFont(
17 wx
.SYS_DEFAULT_GUI_FONT
)
18 font
.SetWeight(wx
.BOLD
)
19 item
= wx
.MenuItem(menu
, -1, "Has Bold Font")
23 item
= wx
.MenuItem(menu
, -1, "Has Red Text")
24 item
.SetTextColour("red")
28 menu
.AppendSeparator()
29 exit
= menu
.Append(-1, "Exit")
30 self
.Bind(wx
.EVT_MENU
, self
.OnExit
, exit
)
32 menuBar
= wx
.MenuBar()
33 menuBar
.Append(menu
, "Menu")
34 self
.SetMenuBar(menuBar
)
37 def OnExit(self
, event
):
41 if __name__
== "__main__":
42 app
= wx
.PySimpleApp()