]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/MultipleChoiceDialog.py
   5 #--------------------------------------------------------------------------- 
   7 def runTest(frame
, nb
, log
): 
   8     lst 
= [ 'apple', 'pear', 'banana', 'coconut', 'orange', 
   9             'etc', 'etc..', 'etc...' ] 
  11     dlg 
= wx
.lib
.dialogs
.MultipleChoiceDialog( 
  13                                 "Pick some from\n this list\nblah blah...", 
  16     if (dlg
.ShowModal() == wx
.ID_OK
): 
  17         print "Selection:", dlg
.GetValue(), " -> ", dlg
.GetValueString() 
  19 #--------------------------------------------------------------------------- 
  27 This is a Python implementation of a dialog that is not yet implemented in wxWindows 
  28 proper, so don't let the wxWindows documentation mislead you. 
  30 <p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst,  
  31 pos = wx.wxDefaultPosition, size = (200,200), style = wx.DEFAULT_DIALOG_STYLE) 
  35 <dt><code>parent</code> 
  39 <dd>The message that will be displayed above the list 
  41 <dt><code>title</code> 
  42 <dd>The text that will appear on the title bar 
  45 <dd>A Python list of choices that will appear in the dialog. 
  48 <dd>The position of the dialog 
  51 <dd>The size of the dialog 
  53 <dt><code>style</code> 
  54 <dd>The style for the dialog. Only styles normally available to wxDialog are 
  59 <b><font size=+1><code>Methods</code></font></b> 
  62 <dt><code>GetValue</code> 
  63 <dd>Returns a tuple containing the indices of the selected items 
  65 <dt><code>GetValueString</code> 
  66 <dd>Returns a tuple containing the text of the selected items 
  70 Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all 
  71 methods applicable to that class. 
  77 if __name__ 
== '__main__': 
  80     run
.main(['', os
.path
.basename(sys
.argv
[0])])