]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/MessageDialog.py
wxUSE_*BOOK checks.
[wxWidgets.git] / wxPython / demo / MessageDialog.py
... / ...
CommitLineData
1
2import wx
3
4#---------------------------------------------------------------------------
5
6class 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
28def runTest(frame, nb, log):
29 win = TestPanel(nb, log)
30 return win
31
32
33#---------------------------------------------------------------------------
34
35
36
37overview = """\
38<html><body>
39<h2>wx.MessageDialog</h2>
40
41This class represents a dialog that shows a single or multi-line
42message, with a choice of OK, Yes, No and Cancel buttons.
43Additionally, various style flags can determine whether an icon is
44displayed, and, if so, what kind. The return value of ShowModal
45indicates which button was pressed.
46
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:])