-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a new SimpleRenderer to handle simple cases. #2279
Add a new SimpleRenderer to handle simple cases. #2279
Conversation
Easiest usage is to return NewSimpleRenderer(myObj) from CreateRenderer Fixes fyne-io#709
widget/widget.go
Outdated
// a single fyne.CanvasObject. | ||
// | ||
// Since: 2.1 | ||
type SimpleRenderer = internalWidget.SimpleRenderer |
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.
I think this should be changed to:
func NewSimpleRenderer(object fyne.CanvasObject) *internalWidget.SimpleRenderer {
return internalWidget.NewSimpleRenderer(object)
}
Otherwise, there is no way to use SimpleRenderer
outside the Fyne repo.
Also I think that with this change every usage of SimpleRenderer
in this package (widget
) should use NewSimpleRenderer
instead of internalWidget.NewSimpleRenderer
(to keep consistency).
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, I missed the NewSimpleRenderer
, and I will update the usages.
However the alias should remain, as we should not return internal
objects from our public API.
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, I missed the NewSimpleRenderer, and I will update the usages.
You're welcome :)
However the alias should remain, as we should not return internal objects from our public API.
Agree 👍
@andydotxyz I wonder if we should use |
Good question. Initially I was following the internal renderers etc and they have exposed methods (like SetObjects). |
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.
Looks good, just some comments :)
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.
LGTM! :)
Description:
Easiest usage is to return NewSimpleRenderer(myObj) from CreateRenderer
Fixes #709
Checklist: