This class represents a dialog that shows a list of strings, and allows the user to select one.
Double-clicking on a list item is equivalent to single-clicking and then pressing wx.OK
.
This class supports the following styles:
wx.OK
: Show an wx.OK
button.wx.CANCEL
: Show a Cancel button.wx.CENTRE
: Centre the message. Not Windows.__init__ |
Constructor, taking an array of String choices and optional client data. |
GetSelection |
Returns the index of selected item. |
GetStringSelection |
Returns the selected string. |
SetSelection |
Sets the index of the initially selected item. |
ShowModal |
Shows the dialog, returning either wx.ID_OK or wx.ID_CANCEL . |
Selection |
See GetSelection and SetSelection |
StringSelection |
See GetStringSelection |
wx.
SingleChoiceDialog
(Dialog)¶PySingleChoiceDialog(parent, message, caption, choices, style=CHOICEDLG_STYLE, pos=DefaultPosition)
This class represents a dialog that shows a list of strings, and allows the user to select one.
__init__
(self, parent, message, caption, choices, style=CHOICEDLG_STYLE, pos=DefaultPosition)¶Constructor, taking an array of String choices and optional client data.
Parameters: |
|
---|
GetSelection
(self)¶Returns the index of selected item.
Return type: | int |
---|
GetStringSelection
(self)¶Returns the selected string.
Return type: | string |
---|
SetSelection
(self, selection)¶Sets the index of the initially selected item.
Parameters: | selection (int) – |
---|
ShowModal
(self)¶Shows the dialog, returning either wx.ID_OK
or wx.ID_CANCEL
.
Return type: | int |
---|
Selection
¶See GetSelection
and SetSelection
StringSelection
¶