-
Notifications
You must be signed in to change notification settings - Fork 153
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
Improvements to widget properties #752
Conversation
CurrentComboProperty has been renamed to CurrentComboDataProperty and CurrentComboTextProperty has been added, to differentiate between cases where the item should be selected based on the text vs data in the combo box. In addition, this adds the ability to define a mapping function for value-based properties. Finally, this adds CurrentTabProperty. The tests have been expanded to cover all widget properties.
|
||
class CurrentComboTextProperty(WidgetProperty): | ||
""" | ||
Wrapper around ComboBoxes |
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.
differentiate docstrings here?
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!
This looks good
That sounds right. I guess we could make it so that callbacks could more easily be attached to WidgetProperties directly (ie maybe WidgetProperty should inherit from CallbackProperty) |
Improvements to widget properties
Several changes in this pull request, following work on the 3-d viewer:
CurrentComboProperty
has been renamed toCurrentComboDataProperty
andCurrentComboTextProperty
has been added, to differentiate between cases where the item should be selected based on the text vs data in the combo box (note that for backward-compatibility,CurrentComboProperty
is set toCurrentComboDataProperty
)CurrentTabProperty
. The tests have been expanded to cover all widget properties.test_widget_properties.py
to test all functions/classes@ChrisBeaumont - am I right in thinking that when one doesn't need an actual callback, but instead just needs the property to be set when called, then the widget properties should be used, whereas if an immediate callback is needed, the callback properties and connect functions should be used?