ComboBox
import { ComboBox } from "std-widgets.slint";export component Example inherits Window { width: 100px; height: 100px; background: transparent; ComboBox { x: 5px; y: 5px; width: 100px; model: ["first", "second", "third"]; current-value: "first"; }}slint
一个按钮,点击后会打开弹出窗口以选择值。
current-index
Section titled “current-index”current-value
Section titled “current-value”string(in-out)default: ""
当前选中的文本。
enabled
Section titled “enabled”booldefault: true
默认为 true。当为 false 时,无法与组合框交互
has-focus
Section titled “has-focus”bool(out)
当组合框具有键盘焦点时设置为 true。
selected(string)
Section titled “selected(string)”用户从组合框中选择了值。参数为当前选中的值。
ComboBox { model: ["first", "second", "third"]; selected(value) => { debug("Selected value: ", value); }}slint
© 2026 SixtyFPS GmbH