Skip to content
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

Merged
merged 1 commit into from
Mar 29, 2022
Merged

Make call_button public #391

merged 1 commit into from
Mar 29, 2022

Conversation

dstansby
Copy link
Contributor

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.

@tlambert03
Copy link
Member

thanks @dstansby. just some outdated tests left that need fixing.

@@ -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
Copy link
Member

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
Copy link

codecov bot commented Mar 29, 2022

Codecov Report

Merging #391 (94b3648) into main (20ba148) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #391   +/-   ##
=======================================
  Coverage   88.61%   88.61%           
=======================================
  Files          30       30           
  Lines        3793     3796    +3     
=======================================
+ Hits         3361     3364    +3     
  Misses        432      432           
Impacted Files Coverage Δ
magicgui/widgets/_function_gui.py 94.06% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20ba148...94b3648. Read the comment docs.

Copy link
Member

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@tlambert03 tlambert03 merged commit 02ebf6d into pyapp-kit:main Mar 29, 2022
@dstansby dstansby deleted the call-button branch March 29, 2022 19:23
@tlambert03 tlambert03 added the enhancement New feature or request label Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants