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
widget.ToolbarItem SetIcon #2040
Comments
You can currently do this: toolbarItem.Icon = theme.QuestionIcon()
toolbar.Refresh() |
Using newest dev branch i get this. Interface have no icon so explains why. |
I'm sorry - I forgot that the return type is the interface. toolbarItem.(*widget.ToolbarAction).Icon = theme.QuestionIcon()
toolbar.Refresh() |
Yes i see, tyvm @andydotxyz
|
I would like to do this one.
@xines I think this way it won't be possible since But I think since we have Another thing we can do is to implement
But then we will have to cast the interface to specific type while using it -
@andydotxyz @xines Any pointers on how can we implement this ? |
Or |
Yes, we can do that too as |
I was also very new to Go when I wrote that code, so it may not be the right way to do it ;). |
Yeah indeed they do.
Id highly recommend giving this a look :) https://go-proverbs.github.io/ |
On |
Is your feature request related to a problem? Please describe:
At the moment ToolBarItem does not have a SetIcon function like widget buttons even tho toolbars are buttons under the hood.
So as a workaround to set the icon it's required to store the fyne.resource icon into variable and re-update content accordingly.
Is it possible to construct a solution with the existing API?
Yes
Describe the solution you'd like to see:
The text was updated successfully, but these errors were encountered: