Skip to content

Commit 9b0f8ca

Browse files
added one more sample
1 parent cded98e commit 9b0f8ca

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

week-09/code/basic_app_1.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Example of the very basic, minimal farmework for a wxPython application
5+
"""
6+
7+
import wx
8+
9+
class TestFrame(wx.Frame):
10+
def __init__(self, *args, **kwargs):
11+
kwargs.setdefault('title', "Simple test App")
12+
wx.Frame.__init__(self, *args, **kwargs)
13+
14+
15+
class TestApp(wx.App):
16+
def OnInit(self):
17+
"""
18+
App initilization goes here -- not much to do, in this case
19+
"""
20+
f = TestFrame(None)
21+
f.Show()
22+
23+
return True
24+
25+
if __name__ == "__main__":
26+
app = TestApp()
27+
app.MainLoop()
28+

week-09/code/basic_app_2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
"""
44
Example of the very basic, minimal farmework for a wxPython application
5+
6+
This version adds a basic menu bar with a file menu
57
"""
68

79
import wx

0 commit comments

Comments
 (0)