]>
Commit | Line | Data |
---|---|---|
cf694132 | 1 | |
8fa876ca | 2 | import wx |
cf694132 RD |
3 | |
4 | #--------------------------------------------------------------------------- | |
5 | ||
34a544a6 RD |
6 | class TestPanel(wx.Panel): |
7 | def __init__(self, parent, log): | |
8 | self.log = log | |
9 | wx.Panel.__init__(self, parent, -1) | |
10 | ||
11 | b = wx.Button(self, -1, "Create and Show a MessageDialog", (50,50)) | |
12 | self.Bind(wx.EVT_BUTTON, self.OnButton, b) | |
13 | ||
14 | ||
15 | def OnButton(self, evt): | |
16 | dlg = wx.MessageDialog(self, 'Hello from Python and wxPython!', | |
17 | 'A Message Box', | |
18 | wx.OK | wx.ICON_INFORMATION | |
19 | #wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION | |
20 | ) | |
21 | dlg.ShowModal() | |
22 | dlg.Destroy() | |
23 | ||
24 | ||
25 | #--------------------------------------------------------------------------- | |
26 | ||
27 | ||
cf694132 | 28 | def runTest(frame, nb, log): |
34a544a6 RD |
29 | win = TestPanel(nb, log) |
30 | return win | |
31 | ||
cf694132 RD |
32 | |
33 | #--------------------------------------------------------------------------- | |
34 | ||
35 | ||
36 | ||
cf694132 | 37 | overview = """\ |
d7403ad2 RD |
38 | <html><body> |
39 | <h2>wx.MessageDialog</h2> | |
40 | ||
41 | This class represents a dialog that shows a single or multi-line | |
42 | message, with a choice of OK, Yes, No and Cancel buttons. | |
43 | Additionally, various style flags can determine whether an icon is | |
44 | displayed, and, if so, what kind. The return value of ShowModal | |
45 | indicates which button was pressed. | |
cf694132 | 46 | |
8fa876ca | 47 | """ |
cf694132 | 48 | |
cf694132 | 49 | |
1fded56b RD |
50 | if __name__ == '__main__': |
51 | import sys,os | |
52 | import run | |
8eca4fef | 53 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) |