]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/MessageDialog.py
   4 #--------------------------------------------------------------------------- 
   6 class TestPanel(wx
.Panel
): 
   7     def __init__(self
, parent
, log
): 
   9         wx
.Panel
.__init
__(self
, parent
, -1) 
  11         b 
= wx
.Button(self
, -1, "Create and Show a MessageDialog", (50,50)) 
  12         self
.Bind(wx
.EVT_BUTTON
, self
.OnButton
, b
) 
  15     def OnButton(self
, evt
): 
  16         dlg 
= wx
.MessageDialog(self
, 'Hello from Python and wxPython!', 
  18                                wx
.OK | wx
.ICON_INFORMATION
 
  19                                #wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION 
  25 #--------------------------------------------------------------------------- 
  28 def runTest(frame
, nb
, log
): 
  29     win 
= TestPanel(nb
, log
) 
  33 #--------------------------------------------------------------------------- 
  39 <h2>wx.MessageDialog</h2> 
  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. 
  50 if __name__ 
== '__main__': 
  53     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])