Ai
15 Star 73 Fork 23

Gitee 极速下载/Fyne

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/fyne-io/fyne
克隆/下载
widget.go 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
package fyne
// Widget defines the standard behaviours of any widget. This extends
// [CanvasObject]. A widget behaves in the same basic way but will encapsulate
// many child objects to create the rendered widget.
type Widget interface {
CanvasObject
// CreateRenderer returns a new [WidgetRenderer] for this widget.
// This should not be called by regular code, it is used internally to render a widget.
CreateRenderer() WidgetRenderer
}
// WidgetRenderer defines the behaviour of a widget's implementation.
// This is returned from a widget's declarative object through [Widget.CreateRenderer]
// and should be exactly one instance per widget in memory.
type WidgetRenderer interface {
// Destroy is a hook that is called when the renderer is being destroyed.
// This happens at some time after the widget is no longer visible, and
// once destroyed, a renderer will not be reused.
// Renderers should dispose and clean up any related resources, if necessary.
Destroy()
// Layout is a hook that is called if the widget needs to be laid out.
// This should never call [Refresh].
Layout(Size)
// MinSize returns the minimum size of the widget that is rendered by this renderer.
MinSize() Size
// Objects returns all objects that should be drawn.
Objects() []CanvasObject
// Refresh is a hook that is called if the widget has updated and needs to be redrawn.
// This might trigger a [Layout].
Refresh()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mirrors/Fyne.git
git@gitee.com:mirrors/Fyne.git
mirrors
Fyne
Fyne
master

搜索帮助