-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Dropdown options with callback #826
Feature: Dropdown options with callback #826
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
examples/component/dropdown.cpp
Outdated
@@ -30,12 +30,12 @@ int main() { | |||
|
|||
auto layout = Container::Vertical({ | |||
Container::Horizontal({ | |||
Dropdown(&entries, &selected_1), | |||
Dropdown(&entries, &selected_1, { .on_change = [&] { selected_3 = selected_1; } } ), // Keep in sync with selected_3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Could you revert this file change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - done 👍
@@ -74,7 +74,7 @@ Component Radiobox(ConstStringListRef entries, | |||
int* selected_, | |||
RadioboxOption options = {}); | |||
|
|||
Component Dropdown(ConstStringListRef entries, int* selected); | |||
Component Dropdown(ConstStringListRef entries, int* selected, DropdownOption options = {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you format?
clang-format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
@ArthurSonzogni Thanks for enhancing the dropdown functionality. I hope you don't mind but I saw the build error and put in a fix to correct it. Let me know if you think this is OK 👍 |
Thanks for your contribution to FTXUI! 👍 |
Co-authored-by: ArthurSonzogni <[email protected]>
Co-authored-by: ArthurSonzogni <[email protected]>
I wanted two things on the dropdown in my application:
Can you consider this PR, please?
Thanks 👍