]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/tests/test_logWindow.py
6 def __init__(self
, *args
, **kw
):
7 wx
.Frame
.__init
__(self
, *args
, **kw
)
8 self
.log
= wx
.LogWindow(self
, "Program Log", False, False)
11 btn1
= wx
.Button(pnl
, -1, "Toggle Log")
12 btn2
= wx
.Button(pnl
, -1, "Log Message")
13 btn3
= wx
.Button(pnl
, -1, "Close")
15 sizer
= wx
.BoxSizer(wx
.VERTICAL
)
16 sizer
.Add(btn1
, 0, wx
.ALL
, 10)
17 sizer
.Add(btn2
, 0, wx
.ALL
, 10)
18 sizer
.Add(btn3
, 0, wx
.ALL
, 10)
21 self
.Bind(wx
.EVT_BUTTON
, self
.OnToggleLog
, btn1
)
22 self
.Bind(wx
.EVT_BUTTON
, self
.OnLogMessage
, btn2
)
23 self
.Bind(wx
.EVT_BUTTON
, self
.OnDoClose
, btn3
)
24 self
.Bind(wx
.EVT_CLOSE
, self
.OnClose
)
27 def OnClose(self
, evt
):
28 self
.log
.this
.disown()
29 wx
.Log
.SetActiveTarget(None)
33 def OnToggleLog(self
, evt
):
34 self
.log
.Show(not self
.log
.GetFrame().IsShown())
36 def OnLogMessage(self
, evt
):
37 wx
.LogMessage("This is a test message")
39 def OnDoClose(self
, evt
):
44 frm
= Frame(None, title
="Testing wx.LogWindow")