]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxNotebook.py
added destructor (correction for Mac OS X)
[wxWidgets.git] / wxPython / demo / wxNotebook.py
CommitLineData
cf694132
RD
1
2from wxPython.wx import *
f0261a72 3
cf694132 4import ColorPanel
f6bcfd97 5import GridSimple
f0261a72
RD
6import wxListCtrl
7import wxScrolledWindow
cf694132
RD
8
9#----------------------------------------------------------------------------
10
eec92d76
RD
11class TestNB(wxNotebook):
12 def __init__(self, parent, id, log):
13 wxNotebook.__init__(self, parent, id, style=wxNB_BOTTOM)
14 self.log = log
cf694132 15
eec92d76
RD
16 win = ColorPanel.ColoredPanel(self, wxBLUE)
17 self.AddPage(win, "Blue")
18 st = wxStaticText(win, -1,
19 "You can put nearly any type of window here,\n"
20 "and the tabs can be on any side... (look below.)",
21 wxPoint(10, 10))
22 st.SetForegroundColour(wxWHITE)
23 st.SetBackgroundColour(wxBLUE)
cf694132 24
eec92d76
RD
25 win = ColorPanel.ColoredPanel(self, wxRED)
26 self.AddPage(win, "Red")
cf694132 27
eec92d76
RD
28 win = wxScrolledWindow.MyCanvas(self)
29 self.AddPage(win, 'ScrolledWindow')
cf694132 30
eec92d76
RD
31 win = ColorPanel.ColoredPanel(self, wxGREEN)
32 self.AddPage(win, "Green")
f0261a72 33
f6bcfd97 34 win = GridSimple.SimpleGrid(self, log)
eec92d76 35 self.AddPage(win, "Grid")
cf694132 36
eec92d76
RD
37 win = wxListCtrl.TestListCtrlPanel(self, log)
38 self.AddPage(win, 'List')
f0261a72 39
eec92d76
RD
40 win = ColorPanel.ColoredPanel(self, wxCYAN)
41 self.AddPage(win, "Cyan")
f0261a72 42
eec92d76
RD
43 win = ColorPanel.ColoredPanel(self, wxWHITE)
44 self.AddPage(win, "White")
cf694132 45
eec92d76
RD
46 win = ColorPanel.ColoredPanel(self, wxBLACK)
47 self.AddPage(win, "Black")
cf694132 48
eec92d76
RD
49 win = ColorPanel.ColoredPanel(self, wxNamedColour('MIDNIGHT BLUE'))
50 self.AddPage(win, "MIDNIGHT BLUE")
cf694132 51
eec92d76
RD
52 win = ColorPanel.ColoredPanel(self, wxNamedColour('INDIAN RED'))
53 self.AddPage(win, "INDIAN RED")
cf694132 54
eec92d76 55 EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged)
cf694132 56
cf694132 57
eec92d76
RD
58 def OnPageChanged(self, event):
59 self.log.write('OnPageChanged\n')
60 event.Skip()
cf694132
RD
61
62
eec92d76 63#----------------------------------------------------------------------------
cf694132 64
eec92d76
RD
65def runTest(frame, nb, log):
66 testWin = TestNB(nb, -1, log)
67 return testWin
68
69#----------------------------------------------------------------------------
cf694132
RD
70
71
72
73
74
75
76
77
78
79
80
81
82overview = """\
83This class represents a notebook control, which manages multiple windows with associated tabs.
84
85To use the class, create a wxNotebook object and call AddPage or InsertPage, passing a window to be used as the page. Do not explicitly delete the window for a page that is currently managed by wxNotebook.
86
cf694132 87"""