Replies: 2 comments 5 replies
-
I believe what you are looking for is a two way binding. Here is your code updated (but I haven't tested this) https://docs.slint.dev/latest/docs/slint/guide/language/concepts/reactivity/#two-way-bindings |
Beta Was this translation helpful? Give feedback.
2 replies
-
Try two-way-bindings (every "property alias" actually is a two-way-binding - took me a while to get the hang. Really nice feature though)… auth-select := ComboBox {
// replace the ":" with "<=>"
current-value <=> Auth.role-name;
} Thats basically all you have to do! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm looking for advice on how to bind a ComboBox
curent-index
/currnet-value
to a property on a global whilst still allowing the user to make a selection.In my example, the ComboBox
current-value
remains bound to theAuth.role-name
property whilst the "Elevate" and "De-auth" buttons are clicked. As soon as the user makes a selection using the ComboBox, the binding is broken. Is there a recommended approach to making this kind of binding?Edit: I would explicitly like to keep the
Auth
out
properties asout
properties. The goal is to enforce the use of the public API, rather than let anyone set these properties directly. You cannot make a two-way binding to anout
property.My example code is here: slint-combobox-binding.zip.
Beta Was this translation helpful? Give feedback.
All reactions