from wxPython.wx import * def hello(event): print 'Hello, world!' class MyApp(wxApp): def OnInit(self): win_id = wxNewId() win = wxFrame(NULL, win_id, 'Hello, wxPython!', size=wxSize(200, 100)) btn_id = wxNewId() btn = wxButton(win, btn_id, 'Hello') EVT_BUTTON(btn, btn_id, hello) win.Show(true) return true app = MyApp() app.MainLoop()
19.15.Frame | ||||
19.15.1. | Set the size of window | |||
19.15.2. | Default frame style | |||
19.15.3. | Creating and Showing a Frame | |||
19.15.4. | Display a frame | |||
19.15.5. | Set top window | |||
19.15.6. | Frame that displays an image. | |||
19.15.7. | Adding Labels and Titles with Keyword Arguments | |||
19.15.8. | Frame with events: on close, on close window | |||
19.15.9. | On init and on exit | |||
19.15.10. | Bind key event and button event | |||
19.15.11. | Set frame properties | |||
19.15.12. | Add contro to frame and layout them | |||
19.15.13. | Subclass frame | |||
19.15.14. | Help Context |