]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/MessageDialog.py
Add BitmapFromBuffer demo
[wxWidgets.git] / wxPython / demo / MessageDialog.py
CommitLineData
cf694132 1
8fa876ca 2import wx
cf694132
RD
3
4#---------------------------------------------------------------------------
5
34a544a6
RD
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
cf694132 28def runTest(frame, nb, log):
34a544a6
RD
29 win = TestPanel(nb, log)
30 return win
31
cf694132
RD
32
33#---------------------------------------------------------------------------
34
35
36
cf694132 37overview = """\
d7403ad2
RD
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.
cf694132 46
8fa876ca 47"""
cf694132 48
cf694132 49
1fded56b
RD
50if __name__ == '__main__':
51 import sys,os
52 import run
8eca4fef 53 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])