]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxMultipleChoiceDialog.py
1 # 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
3 # o Updated for wx namespace
5 # 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
7 # o wx renamer not applied to lib.
11 import wx
.lib
.dialogs
as dlgs
13 #---------------------------------------------------------------------------
15 def runTest(frame
, nb
, log
):
16 lst
= [ 'apple', 'pear', 'banana', 'coconut', 'orange',
17 'etc', 'etc..', 'etc...' ]
19 dlg
= dlgs
.wxMultipleChoiceDialog(frame
,
20 "Pick some from\n this list\nblah blah...",
23 if (dlg
.ShowModal() == wx
.ID_OK
):
24 print "Selection:", dlg
.GetValue(), " -> ", dlg
.GetValueString()
26 #---------------------------------------------------------------------------
34 This is a Python implementation of a dialog that is not yet implemented in wxWindows
35 proper, so don't let the wxWindows documentation mislead you.
37 <p><code><b>wxMultipleChoiceDialog</b>(self, parent, msg, title, lst,
38 pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE)
42 <dt><code>parent</code>
46 <dd>The message that will be displayed above the list
48 <dt><code>title</code>
49 <dd>The text that will appear on the title bar
52 <dd>A Python list of choices that will appear in the dialog.
55 <dd>The position of the dialog
58 <dd>The size of the dialog
60 <dt><code>style</code>
61 <dd>The style for the dialog. Only styles normally available to wxDialog are
66 <b><font size=+1><code>Methods</code></font></b>
69 <dt><code>GetValue</code>
70 <dd>Returns a tuple containing the indices of the selected items
72 <dt><code>GetValueString</code>
73 <dd>Returns a tuple containing the text of the selected items
77 Additionally, wxMultipleChoiceDialog.lbox is a standard wxListBox which supports all
78 methods applicable to that class.
84 if __name__
== '__main__':
87 run
.main(['', os
.path
.basename(sys
.argv
[0])])