pyguiadapter.widgets.choicebox
控件配置类
ChoiceBoxConfig
dataclass
Bases: CommonParameterWidgetConfig
ChoiceBox的配置类
Source code in pyguiadapter\widgets\extend\choicebox.py
add_user_input: bool = True
class-attribute
instance-attribute
在editable
为True
时,用户输入的内容是否作为新的选项添加到选项列表中
choices: Union[Dict[str, Any], Sequence[Any]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
选项列表,可以是字典或列表、元组等序列对象。为字典时,键值对的键为显示文本,值为实际值;为序列对象时,对序列中的每个元素调用str()
,
以其返回值作为显示文本,元素本身作为实际值。
default_value: Optional[Any] = _FIRST_ITEM
class-attribute
instance-attribute
默认选项,_FIRST_ITEM
是一个特殊值,表示选择选项列表中的第一个
editable: bool = False
class-attribute
instance-attribute
是否允许编辑
控件类
ChoiceBox
Bases: CommonParameterWidget
对应参数数据类型
choice_t