diplomat.wx_gui.settings_dialog.DropDown¶
- class diplomat.wx_gui.settings_dialog.DropDown(options: List[Any], option_names: List[str] | None = None, default: int = 0, **kwargs)[source]¶
Bases:
SettingWidgetA SettingWidget for representing a drop-down, or selection widget. Allows the user to select from a list of options.
- __init__(options: List[Any], option_names: List[str] | None = None, default: int = 0, **kwargs)[source]¶
Create a new drop-down widget.
- Parameters:
options – The list of objects to select from.
option_names – Optional, a list of names to actually display in the selection box. If not set or set to None, this widget gets display names by calling the str function on each object in the options list.
default – The index of the default selected value when the widget is first loaded. Defaults to 0, or the first element in the selection box.
Methods
__init__(options[, option_names, default])Create a new drop-down widget.
get_new_widget([parent])Get a widget capable of changing this setting.
Get the current value of this setting.
set_hook(hook)Set the hook function for this setting, this is called whenever the setting is changed.
- get_new_widget(parent=None) wx.Control[source]¶
Get a widget capable of changing this setting.
- Parameters:
parent – The parent container this wxWidget will be placed in.
- Returns:
A wx.Control, to be used to update this setting in the user interface.