+
+class MyFrame(wxFrame):
+ def __init__(self, wf):
+ self.wf = wf
+ wxFrame.__init__(self, NULL, -1, "hangman", wxDefaultPosition, wxSize(400,300))
+ self.wnd = HangmanWnd(self, -1)
+ menu = wxMenu()
+ menu.Append(1001, "New")
+ menu.Append(1002, "End")
+ menu.AppendSeparator()
+ menu.Append(1003, "Reset")
+ menu.AppendSeparator()
+ menu.Append(1004, "Exit")
+ menubar = wxMenuBar()
+ menubar.Append(menu, "Game")
+ menu = wxMenu()
+ menu.Append(1010, "Internal", "Use internal dictionary", TRUE)
+ menu.Append(1011, "ASCII File...")
+ menubar.Append(menu, "Dictionary")
+ self.SetMenuBar(menubar)
+ self.CreateStatusBar(2)
+ EVT_MENU(self, 1001, self.OnGameNew)
+ EVT_MENU(self, 1002, self.OnGameEnd)
+ EVT_MENU(self, 1003, self.OnGameReset)
+ EVT_MENU(self, 1004, self.OnWindowClose)
+ EVT_MENU(self, 1011, self.OnDictFile)
+ EVT_CHAR(self.wnd, self.OnChar)
+ self.OnGameReset()