-
-
Notifications
You must be signed in to change notification settings - Fork 684
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 Command properties dynamically updatable #2700
Comments
Originally posted by @freakboy3742 I think this is likely in the space between a feature and a bug. It's a bug in as much as it seems obvious that you should be able to change labels; it's a request for a new feature on the basis that nothing in the docs says that this behavior should be possible. When you remove then re-add the toolbar, you're forcing a refresh; hence, the new labels are applied. You'd likely find that you'd have the same effect if you added or removed a single item to the toolbar. This is because there is a listener in place on changes to the toolbar, which causes the whole toolbar to be recreated. So - the simplest "fix" for this would be to modify the property for the command label to trigger an update on any command set it is a part of. The complication here is that the command doesn't know what command sets it is part of. A better fix would be to connect changes in the command label to the refreshing underlying command implementation, which should give you access to the underlying native menu and toolbar items. This would allow the labels for those items to be updated directly. |
This applies not just to It also applies to |
Thanks for putting this in your 'TODO' list. 👍 |
@rontarrant To set expectations: yes, this is on our "TODO" in the sense that we've recognised the issue as something we'd like to see addressed - but that doesn't mean it's going to be addressed in the near future. Toga (and the whole of BeeWare) is an Open Source project. The only way to guarantee that something will be fixed is to fix it yourself. We can't provide any guarantees that a someone else will implement a feature, or the timeline on which that will occur. All I can tell you is that this specific issue isn't likely to be on my personal radar for at least 6 months, if not longer. If this is an issue that impacts you, then I'd encourage you to make an attempt at fixing it. We're happy to provide any assistance or pointers to get you started, and we'll review any contributions that are made (merging once they pass review). |
Noted, @freakboy3742 . I've got my hands full already, but I'll add it to my list of things I might get to sometime down the road... if I get some free time. For now, I'll use PySide6 for my current projects. Deadlines, you know. |
Discussed in #2691
Originally posted by @rontarrant
Hey, there, all,
I've been playing around with the example in section 4.1.4 of the Toga docs. Just for fun, I decided to have the
Action 4
toolbar button change the text in theAction 3
toolbar button.Here are my modifications:
However, the text on
Action 3
didn't change. I threw in aprint()
statement to make sure the change was actually taking place (and it was) but the only way to see the change in the toolbar button was to remove the entire toolbar and put it back... which—of course—causes the UI to 'jump.'Question: Is there a way to change the text that's more straightforward? Like, is there a way to access the
toolbar
button's text directly instead of through theCommand
object?Likewise for the Menu item.
The text was updated successfully, but these errors were encountered: