]>
Commit | Line | Data |
---|---|---|
8fa876ca RD |
1 | |
2 | import wx | |
33785d9f | 3 | import wx.lib.dialogs |
cf694132 RD |
4 | |
5 | #--------------------------------------------------------------------------- | |
6 | ||
34a544a6 RD |
7 | class 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 | ||
cf694132 | 29 | def runTest(frame, nb, log): |
34a544a6 RD |
30 | win = TestPanel(nb, log) |
31 | return win | |
cf694132 RD |
32 | |
33 | #--------------------------------------------------------------------------- | |
34 | ||
35 | ||
36 | ||
1fded56b | 37 | overview = """\ |
cf694132 | 38 | |
33785d9f | 39 | <code><b>ScrolledMessageDialog</b>(parent, msg, caption, pos=wx.DefaultPosition, size=(500,300))</code> |
cf694132 | 40 | |
8fa876ca RD |
41 | This class represents a message dialog that uses a wxTextCtrl to display the |
42 | message. This allows more flexible information display without having to be | |
43 | as much concerned with layout requirements. A text file can simply be used | |
cf694132 | 44 | |
8fa876ca RD |
45 | This dialog offers no special attributes or methods beyond those supported |
46 | by wxDialog. | |
1fded56b | 47 | |
8fa876ca | 48 | """ |
1fded56b RD |
49 | |
50 | if __name__ == '__main__': | |
51 | import sys,os | |
52 | import run | |
8eca4fef | 53 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) |