disable/enable components #390
Answered
by
ArthurSonzogni
Chasikanaft
asked this question in
Q&A
-
How enable/disable components like a buttons? |
Beta Was this translation helpful? Give feedback.
Answered by
ArthurSonzogni
Apr 28, 2022
Replies: 1 comment 7 replies
-
Hello! To enable/disable an arbitrary component, you can wrap them with bool button_enabled = true;
auto button = Button("Disable this button ", []{
button_enabled = false;
});
auto maybe_button = Maybe(button, &button_enabled); To change the button's state, you can pass a reference to its state and modify it: std::string label = "button label";
auto button = Button(&label, [&] {
label = "new label";
}); |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
ArthurSonzogni
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
To enable/disable an arbitrary component, you can wrap them with
Maybe
.For example:
To change the button's state, you can pass a reference to its state and modify it: