wxPython学习2005-07-21
2005-07-21 17:17
211 查看
# Start of file from wxPython.wx import * ID_ABOUT = 101 ID_EXIT = 102 class MyFrame(wxFrame): def __init__(self, parent, ID, title): wxFrame.__init__(self, parent, ID, title, wxDefaultPosition, wxSize(200, 150)) self.CreateStatusBar() self.SetStatusText("This is the statusbar") menu = wxMenu() menu.Append(ID_ABOUT, "&About","More information about this program") menu.AppendSeparator() menu.Append(ID_EXIT, "E&xit", "Terminate the program") menuBar = wxMenuBar() menuBar.Append(menu, "&File"); self.SetMenuBar(menuBar) EVT_MENU(self, ID_ABOUT, self.OnAbout) EVT_MENU(self, ID_EXIT, self.TimeToQuit) def OnAbout(self, event): dlg = wxMessageDialog(self, "This sample program shows off/n" "frames, menus, statusbars, and this/n" "message dialog.", "About Me", wxOK | wxICON_INFORMATION) dlg.ShowModal() dlg.Destroy() def TimeToQuit(self, event): self.Close(True) class App(wxApp): def OnInit(self): frame = MyFrame(NULL, -1, "Hello from wxPython") frame.Show(True) self.SetTopWindow(frame) return True if __name__ == "__main__": app = App(0) app.MainLoop() # end of file |
相关文章推荐
- 学习wxPython 的第一个程序
- [python]wxPython学习记录1
- [python]wxpython学习记录2
- wxpython学习1
- wxpython_GUI学习笔记(4)——wxFormBuilder
- wxPython学习001
- wxPython控件学习续
- wxPython控件学习之wx.BoxSizer
- [wxPython学习]wx.CallAfter和wx.FutureCall
- 学习 wxpython_序
- wxPython控件学习之wx.TextCtrl
- python的GUI编程--wxpython学习(一)--安装和原理步骤
- python学习——初次接触(python,wxpython,Boa,py2exe)
- wxpython 学习笔记 第一天
- 【转】wxPython控件学习之TextCtrl(三)响应文本控件事件
- wxpython之dialog学习
- wxPython控件学习
- wxPython学习--文本显示
- 通过wxPython学习wxWindow
- wxpython图形界面学习之简易记事本