]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/ScrolledMessageDialog.py
fix compilation problem when wxUSE_FSVOLUME==0 after last commit: declare wxIsDriveAv...
[wxWidgets.git] / wxPython / demo / ScrolledMessageDialog.py
... / ...
CommitLineData
1
2import wx
3import wx.lib.dialogs
4
5#---------------------------------------------------------------------------
6
7class TestPanel(wx.Panel):
8 def __init__(self, parent, log):
9 self.log = log
10 wx.Panel.__init__(self, parent, -1)
11
12 b = wx.Button(self, -1, "Create and Show a ScrolledMessageDialog", (50,50))
13 self.Bind(wx.EVT_BUTTON, self.OnButton, b)
14
15
16 def OnButton(self, evt):
17 f = open("Main.py", "r")
18 msg = f.read()
19 f.close()
20
21 dlg = wx.lib.dialogs.ScrolledMessageDialog(self, msg, "message test")
22 dlg.ShowModal()
23
24
25
26#---------------------------------------------------------------------------
27
28
29def runTest(frame, nb, log):
30 win = TestPanel(nb, log)
31 return win
32
33#---------------------------------------------------------------------------
34
35
36
37overview = """\
38
39<code><b>ScrolledMessageDialog</b>(parent, msg, caption, pos=wx.DefaultPosition, size=(500,300))</code>
40
41This class represents a message dialog that uses a wxTextCtrl to display the
42message. This allows more flexible information display without having to be
43as much concerned with layout requirements. A text file can simply be used
44
45This dialog offers no special attributes or methods beyond those supported
46by wxDialog.
47
48"""
49
50if __name__ == '__main__':
51 import sys,os
52 import run
53 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])