-
Notifications
You must be signed in to change notification settings - Fork 49
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
Label option for boolean parameters has no effect #109
Comments
Do you want the text on the button itself to say ABC? Or actually have a label next to the button? If the former, use the "text" parameter for buttons: https://napari.org/magicgui/_autosummary/magicgui.widgets.PushButton.html#magicgui.widgets.PushButton If the latter, that would indeed require a change, I originally felt like buttons with text didn't need additional labels |
(I see the special case is confusing though, so maybe label should be an alias for text on buttons?) |
@tlambert03 why are you mentioning push buttons? This is a label next to a tick mark? Or am I getting confused with the terminology? |
lol ... no sorry... was just waking up. In any case, the same point applies, because all |
In case I'm still being confusing. The following works: from magicgui import magicgui
@magicgui(check={'text': 'ABC'})
def test(check: bool):
pass if it's still confusing consider the case when |
Hmm, I guess that making them synonymous seems currently to be the best idea. Perhaps some warning should be shown which recommends the user to use the text field? Or is that unnecessary? |
👍
I think it's necessary until we can make it less confusing! 😂 thanks for raising the issue |
Hey @tlambert03 , I just had a similar issue with labels of checkboxes. From within a magicgui annotated function a, I was doing this:
and it didn't show any effect. However, when doing
it works. Full code here. If you want to reproduce it in more detail, I'm happy to write a more detailed example. But maybe the bug is obvious? Thanks! |
What version are you using? That should have been fixed in #150, released in 0.2.7 |
Ohhh sorry, that will only work during instantiation. Yeah, technically "text" is just the correct thing to use here, not label. "Label" is reserved to mean when there is an additional widget that labels the primary widget. But ButtonWidgets have their own text IN the widget. I see that that is a bit confusing, but it's two separate bits of text... will think about how to clarify |
I my case it's a checkbox. I'm now updating both parameters, it works and it doesn't throw any error or warning. So I'm fine. I'm just not sure if this should be simplified. |
there's no need to update both parameters. |
Ahh, now I get it :-) Thanks for the explanation. |
yeah, it's not awesome 😂 sorry... i do need to be able to represent both things, but I also need to make it less confusing! |
Describe the bug
When setting a custom label attribute for a boolean parameter in a magicgui decorated function, the label of the object in the GUI doesn't update accordingly.
To Reproduce
Expected behavior
The shown label should be 'ABC'.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: