-
Notifications
You must be signed in to change notification settings - Fork 50
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
Make call_button public #391
Conversation
thanks @dstansby. just some outdated tests left that need fixing. |
magicgui/widgets/_function_gui.py
Outdated
@@ -186,23 +187,23 @@ def __init__( | |||
|
|||
if call_button is None: | |||
call_button = not auto_call | |||
self._call_button: PushButton | None = None | |||
self.call_button: PushButton | None = None |
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.
actually, i might prefer a public accessor rather than changing the private attr.
@property
def call_button(self) -> Optional[PushButton]:
return self._call_button
Codecov Report
@@ Coverage Diff @@
## main #391 +/- ##
=======================================
Coverage 88.61% 88.61%
=======================================
Files 30 30
Lines 3793 3796 +3
=======================================
+ Hits 3361 3364 +3
Misses 432 432
Continue to review full report at Codecov.
|
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!
See https://github.com/napari/magicgui/issues/381#issuecomment-1060550957 and associated discussion. This allows public access to the button automatically created by
magicgui
so it can be modified after creating the GUI.