Documentation ¶
Index ¶
- type AnchorLayout
- func (p *AnchorLayout) AppendChild(child WidgetInterface) *AnchorLayout
- func (p *AnchorLayout) Destroy()
- func (p *AnchorLayout) Direction(direc anchor.Direction) *AnchorLayout
- func (p *AnchorLayout) GetChild() WidgetInterface
- func (p *AnchorLayout) Layout(gtx glayout.Context) (dimensions glayout.Dimensions)
- func (p *AnchorLayout) Margin(Top, Left, Bottom, Right float32) *AnchorLayout
- func (p *AnchorLayout) OnDestroy(fn func())
- func (p *AnchorLayout) RemoveChild() *AnchorLayout
- func (p *AnchorLayout) ResetParent(child WidgetInterface)
- func (p *AnchorLayout) Then(fn func(self *AnchorLayout)) *AnchorLayout
- func (p *AnchorLayout) Update(update bool)
- type Border
- func (p *Border) AppendChild(child WidgetInterface) *Border
- func (p *Border) Color(r, g, b, a uint8) *Border
- func (p *Border) CornerRadius(radius float32) *Border
- func (p *Border) Destroy()
- func (p *Border) GetChild() WidgetInterface
- func (p *Border) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *Border) Margin(Top, Left, Bottom, Right float32) *Border
- func (p *Border) OnDestroy(fn func())
- func (p *Border) Padding(Top, Left, Bottom, Right float32) *Border
- func (p *Border) RemoveChild() *Border
- func (p *Border) ResetParent(child WidgetInterface)
- func (p *Border) Then(fn func(self *Border)) *Border
- func (p *Border) Update(update bool)
- func (p *Border) Width(width float32) *Border
- type Button
- func (p *Button) Background(r, g, b, a uint8) *Button
- func (p *Button) Click() *Button
- func (p *Button) CornerRadius(radius float32) *Button
- func (p *Button) Destroy()
- func (p *Button) Focus() *Button
- func (p *Button) FontColor(r, g, b, a uint8) *Button
- func (p *Button) FontSize(size int) *Button
- func (p *Button) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *Button) Margin(top, left, bottom, right float32) *Button
- func (p *Button) OnClicked(fn func(p *Button)) *Button
- func (p *Button) OnDestroy(fn func())
- func (p *Button) OnFocused(fn func(p *Button, focus bool)) *Button
- func (p *Button) OnHovered(fn func(p *Button, hover bool)) *Button
- func (p *Button) OnLongClicked(fn func(p *Button)) *Button
- func (p *Button) OnPressed(fn func(p *Button)) *Button
- func (p *Button) Padding(top, left, bottom, right float32) *Button
- func (p *Button) Text(text string) *Button
- func (p *Button) Then(fn func(self *Button)) *Button
- func (p *Button) Update(update bool)
- type CheckBox
- func (p *CheckBox) CheckMarkColor(r, g, b, a uint8) *CheckBox
- func (p *CheckBox) Checked(checked bool) *CheckBox
- func (p *CheckBox) Destroy()
- func (p *CheckBox) FontColor(r, g, b, a uint8) *CheckBox
- func (p *CheckBox) GetChecked() bool
- func (p *CheckBox) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *CheckBox) Margin(Top, Left, Bottom, Right float32) *CheckBox
- func (p *CheckBox) OnChecked(fn func(p *CheckBox, check bool)) *CheckBox
- func (p *CheckBox) OnDestroy(fn func())
- func (p *CheckBox) OnFocused(fn func(p *CheckBox, focus bool, value bool)) *CheckBox
- func (p *CheckBox) OnHovered(fn func(p *CheckBox, hover bool, check bool)) *CheckBox
- func (p *CheckBox) Size(size float32) *CheckBox
- func (p *CheckBox) Text(text string) *CheckBox
- func (p *CheckBox) Then(fn func(self *CheckBox)) *CheckBox
- func (p *CheckBox) Update(update bool)
- type ColumnLayout
- func (p *ColumnLayout) AppendFlexAnchorChild(weight float32, direction anchor.Direction, child WidgetInterface) *ColumnLayout
- func (p *ColumnLayout) AppendFlexChild(weight float32, child WidgetInterface) *ColumnLayout
- func (p *ColumnLayout) AppendRigidChild(child WidgetInterface) *ColumnLayout
- func (p *ColumnLayout) Destroy()
- func (p *ColumnLayout) GetChildAll() []WidgetInterface
- func (p *ColumnLayout) GetChildAt(index int) WidgetInterface
- func (p *ColumnLayout) GetChildCount() int
- func (p *ColumnLayout) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *ColumnLayout) Margin(Top, Left, Bottom, Right float32) *ColumnLayout
- func (p *ColumnLayout) OnDestroy(fn func())
- func (p *ColumnLayout) RemoveChild(child WidgetInterface) *ColumnLayout
- func (p *ColumnLayout) RemoveChildAll() *ColumnLayout
- func (p *ColumnLayout) RemoveChildAt(index int) *ColumnLayout
- func (p *ColumnLayout) ResetParent(child WidgetInterface)
- func (p *ColumnLayout) Then(fn func(self *ColumnLayout)) *ColumnLayout
- func (p *ColumnLayout) Update(update bool)
- type ContainerLayout
- func (p *ContainerLayout) AppendChild(child WidgetInterface) *ContainerLayout
- func (p *ContainerLayout) Background(r, g, b, a uint8) *ContainerLayout
- func (p *ContainerLayout) Destroy()
- func (p *ContainerLayout) GetChild() WidgetInterface
- func (p *ContainerLayout) Layout(gtx glayout.Context) (dimensions glayout.Dimensions)
- func (p *ContainerLayout) Margin(Top, Left, Bottom, Right float32) *ContainerLayout
- func (p *ContainerLayout) OnDestroy(fn func())
- func (p *ContainerLayout) RemoveChild() *ContainerLayout
- func (p *ContainerLayout) ResetParent(child WidgetInterface)
- func (p *ContainerLayout) Then(fn func(self *ContainerLayout)) *ContainerLayout
- func (p *ContainerLayout) Update(update bool)
- type Editor
- func (p *Editor) Alignment(alignment text.Alignment) *Editor
- func (p *Editor) AllowOnly(filter string) *Editor
- func (p *Editor) CaretPos() (line, col int)
- func (p *Editor) ClearSelection() *Editor
- func (p *Editor) Delete(count int) *Editor
- func (p *Editor) Destroy()
- func (p *Editor) Focus() *Editor
- func (p *Editor) FontSize(textSize float32) *Editor
- func (p *Editor) GetSelectedText() string
- func (p *Editor) GetSelection() (start, end int)
- func (p *Editor) GetSelectionLen() int
- func (p *Editor) GetText() string
- func (p *Editor) GetTextLen() int
- func (p *Editor) Hint(hint string) *Editor
- func (p *Editor) HintColor(r, g, b, a uint8) *Editor
- func (p *Editor) Insert(text string) *Editor
- func (p *Editor) KeyboardType(keyboardType text.InputHint) *Editor
- func (p *Editor) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *Editor) LineHeight(lineHeight float32) *Editor
- func (p *Editor) LineHeightScale(lineHeightScale float32) *Editor
- func (p *Editor) Margin(Top, Left, Bottom, Right float32) *Editor
- func (p *Editor) Mask(mask rune) *Editor
- func (p *Editor) MaxLength(maxLines int) *Editor
- func (p *Editor) MoveCaret(startDelta, endDelta int) *Editor
- func (p *Editor) OnChange(fn func(p *Editor, text string)) *Editor
- func (p *Editor) OnDestroy(fn func())
- func (p *Editor) OnFocused(fn func(p *Editor, focus bool, text string)) *Editor
- func (p *Editor) OnSelect(fn func(p *Editor, text string)) *Editor
- func (p *Editor) OnSubmit(fn func(p *Editor, text string)) *Editor
- func (p *Editor) ReadOnly(readOnly bool) *Editor
- func (p *Editor) SelectionColor(r, g, b, a uint8) *Editor
- func (p *Editor) SetCaret(start, end int) *Editor
- func (p *Editor) SingleLine(singleLine bool) *Editor
- func (p *Editor) Submit(submit bool) *Editor
- func (p *Editor) Text(text string) *Editor
- func (p *Editor) TextColor(r, g, b, a uint8) *Editor
- func (p *Editor) TextWeight(textWeight text.Weight) *Editor
- func (p *Editor) Then(fn func(self *Editor)) *Editor
- func (p *Editor) Update(update bool)
- func (p *Editor) WrapPolicy(wrapPolicy text.WrapPolicy) *Editor
- type Label
- func (p *Label) Alignment(alignment text.Alignment) *Label
- func (p *Label) Destroy()
- func (p *Label) FontColor(r, g, b, a uint8) *Label
- func (p *Label) FontSize(size float32) *Label
- func (p *Label) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *Label) LineHeight(lineHeight float32) *Label
- func (p *Label) LineHeightScale(lineHeightScale float32) *Label
- func (p *Label) Margin(Top, Left, Bottom, Right float32) *Label
- func (p *Label) MaxLines(maxLines int) *Label
- func (p *Label) OnDestroy(fn func())
- func (p *Label) Text(text string) *Label
- func (p *Label) Then(fn func(self *Label)) *Label
- func (p *Label) Truncator(truncator string) *Label
- func (p *Label) Update(update bool)
- func (p *Label) WrapPolicy(wrapPolicy text.WrapPolicy) *Label
- type ListLayout
- func (p *ListLayout) AppendChild(child WidgetInterface) *ListLayout
- func (p *ListLayout) Axis(axis axis.Axis) *ListLayout
- func (p *ListLayout) Destroy()
- func (p *ListLayout) GetChildAll() []WidgetInterface
- func (p *ListLayout) GetChildAt(index int) WidgetInterface
- func (p *ListLayout) GetChildCount() int
- func (p *ListLayout) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *ListLayout) Margin(Top, Left, Bottom, Right float32) *ListLayout
- func (p *ListLayout) OnDestroy(fn func())
- func (p *ListLayout) RemoveChild(child WidgetInterface) *ListLayout
- func (p *ListLayout) RemoveChildAll() *ListLayout
- func (p *ListLayout) RemoveChildAt(index int) *ListLayout
- func (p *ListLayout) ResetParent(child WidgetInterface)
- func (p *ListLayout) ScrollBgColor(r, g, b, a uint8) *ListLayout
- func (p *ListLayout) ScrollBy(offset float32) *ListLayout
- func (p *ListLayout) ScrollColor(r, g, b, a uint8) *ListLayout
- func (p *ListLayout) ScrollCornerRadius(radius float32) *ListLayout
- func (p *ListLayout) ScrollHoverColor(r, g, b, a uint8) *ListLayout
- func (p *ListLayout) ScrollMinLen(minLen float32) *ListLayout
- func (p *ListLayout) ScrollPadding(width, height float32) *ListLayout
- func (p *ListLayout) ScrollPaddingEnable(enable bool) *ListLayout
- func (p *ListLayout) ScrollToEnd(scrollToEnd bool) *ListLayout
- func (p *ListLayout) ScrollToItem(index int) *ListLayout
- func (p *ListLayout) ScrollWidth(width float32) *ListLayout
- func (p *ListLayout) Then(fn func(self *ListLayout)) *ListLayout
- func (p *ListLayout) Update(update bool)
- type MultiChildLayoutInterface
- type RadioButtons
- func (p *RadioButtons) AppendRadioButton(key, text string) *RadioButtons
- func (p *RadioButtons) Axis(axis axis.Axis) *RadioButtons
- func (p *RadioButtons) Destroy()
- func (p *RadioButtons) FontColor(r, g, b, a uint8) *RadioButtons
- func (p *RadioButtons) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *RadioButtons) Margin(Top, Left, Bottom, Right float32) *RadioButtons
- func (p *RadioButtons) OnDestroy(fn func())
- func (p *RadioButtons) OnFocused(fn func(p *RadioButtons, key string)) *RadioButtons
- func (p *RadioButtons) OnHovered(fn func(p *RadioButtons, key string)) *RadioButtons
- func (p *RadioButtons) OnSelected(fn func(p *RadioButtons, key string)) *RadioButtons
- func (p *RadioButtons) RadioMarkColor(r, g, b, a uint8) *RadioButtons
- func (p *RadioButtons) Size(size float32) *RadioButtons
- func (p *RadioButtons) Then(fn func(self *RadioButtons)) *RadioButtons
- func (p *RadioButtons) Update(update bool)
- type RowLayout
- func (p *RowLayout) AppendFlexAnchorChild(weight float32, direction anchor.Direction, child WidgetInterface) *RowLayout
- func (p *RowLayout) AppendFlexChild(weight float32, child WidgetInterface) *RowLayout
- func (p *RowLayout) AppendRigidChild(child WidgetInterface) *RowLayout
- func (p *RowLayout) Destroy()
- func (p *RowLayout) GetChildAll() []WidgetInterface
- func (p *RowLayout) GetChildAt(index int) WidgetInterface
- func (p *RowLayout) GetChildCount() int
- func (p *RowLayout) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *RowLayout) Margin(Top, Left, Bottom, Right float32) *RowLayout
- func (p *RowLayout) OnDestroy(fn func())
- func (p *RowLayout) RemoveChild(child WidgetInterface) *RowLayout
- func (p *RowLayout) RemoveChildAll() *RowLayout
- func (p *RowLayout) RemoveChildAt(index int) *RowLayout
- func (p *RowLayout) ResetParent(child WidgetInterface)
- func (p *RowLayout) Then(fn func(self *RowLayout)) *RowLayout
- func (p *RowLayout) Update(update bool)
- type SingleChildLayoutInterface
- type Slider
- func (p *Slider) Color(r, g, b, a uint8) *Slider
- func (p *Slider) Destroy()
- func (p *Slider) FingerSize(size float32) *Slider
- func (p *Slider) GetValue() float32
- func (p *Slider) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *Slider) Margin(Top, Left, Bottom, Right float32) *Slider
- func (p *Slider) OnDestroy(fn func())
- func (p *Slider) OnDragging(fn func(p *Slider, value float32)) *Slider
- func (p *Slider) Then(fn func(self *Slider)) *Slider
- func (p *Slider) Update(update bool)
- type Switch
- func (p *Switch) Destroy()
- func (p *Switch) DisabledColor(r, g, b, a uint8) *Switch
- func (p *Switch) Enabled(value bool) *Switch
- func (p *Switch) EnabledColor(r, g, b, a uint8) *Switch
- func (p *Switch) Layout(gtx glayout.Context) glayout.Dimensions
- func (p *Switch) Margin(Top, Left, Bottom, Right float32) *Switch
- func (p *Switch) OnChange(fn func(p *Switch, value bool)) *Switch
- func (p *Switch) OnDestroy(fn func())
- func (p *Switch) Then(fn func(self *Switch)) *Switch
- func (p *Switch) TrackColor(r, g, b, a uint8) *Switch
- func (p *Switch) Update(update bool)
- type WidgetInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnchorLayout ¶
type AnchorLayout struct {
// contains filtered or unexported fields
}
锚定布局
func (*AnchorLayout) AppendChild ¶
func (p *AnchorLayout) AppendChild(child WidgetInterface) *AnchorLayout
设置子节点
func (*AnchorLayout) Direction ¶
func (p *AnchorLayout) Direction(direc anchor.Direction) *AnchorLayout
设置锚定方向
func (*AnchorLayout) Layout ¶
func (p *AnchorLayout) Layout(gtx glayout.Context) (dimensions glayout.Dimensions)
渲染
func (*AnchorLayout) Margin ¶
func (p *AnchorLayout) Margin(Top, Left, Bottom, Right float32) *AnchorLayout
设置外边距
func (*AnchorLayout) ResetParent ¶
func (p *AnchorLayout) ResetParent(child WidgetInterface)
重新设置父节点
func (*AnchorLayout) Then ¶
func (p *AnchorLayout) Then(fn func(self *AnchorLayout)) *AnchorLayout
绑定函数
type Button ¶
type Button struct {
// contains filtered or unexported fields
}
type CheckBox ¶
type CheckBox struct {
// contains filtered or unexported fields
}
复选框
func (*CheckBox) CheckMarkColor ¶
设置勾选框左边标记的颜色
type ColumnLayout ¶
type ColumnLayout struct {
// contains filtered or unexported fields
}
func (*ColumnLayout) AppendFlexAnchorChild ¶
func (p *ColumnLayout) AppendFlexAnchorChild(weight float32, direction anchor.Direction, child WidgetInterface) *ColumnLayout
添加子节点,可以根据方向进行布局堆叠
func (*ColumnLayout) AppendFlexChild ¶
func (p *ColumnLayout) AppendFlexChild(weight float32, child WidgetInterface) *ColumnLayout
添加子节点,并且可以定义权重
func (*ColumnLayout) AppendRigidChild ¶
func (p *ColumnLayout) AppendRigidChild(child WidgetInterface) *ColumnLayout
添加子节点,组件得到基于子组件的固定空间
func (*ColumnLayout) GetChildAt ¶
func (p *ColumnLayout) GetChildAt(index int) WidgetInterface
获取指定索引的子节点
func (*ColumnLayout) Layout ¶
func (p *ColumnLayout) Layout(gtx glayout.Context) glayout.Dimensions
渲染UI
func (*ColumnLayout) Margin ¶
func (p *ColumnLayout) Margin(Top, Left, Bottom, Right float32) *ColumnLayout
设置外边距
func (*ColumnLayout) RemoveChild ¶
func (p *ColumnLayout) RemoveChild(child WidgetInterface) *ColumnLayout
从组件删除子节点
func (*ColumnLayout) RemoveChildAt ¶
func (p *ColumnLayout) RemoveChildAt(index int) *ColumnLayout
从指定索引删除子节点
func (*ColumnLayout) ResetParent ¶
func (p *ColumnLayout) ResetParent(child WidgetInterface)
重新设置父节点
func (*ColumnLayout) Then ¶
func (p *ColumnLayout) Then(fn func(self *ColumnLayout)) *ColumnLayout
绑定函数
type ContainerLayout ¶
type ContainerLayout struct {
// contains filtered or unexported fields
}
容器布局,只用于包裹组件
func (*ContainerLayout) AppendChild ¶
func (p *ContainerLayout) AppendChild(child WidgetInterface) *ContainerLayout
设置子节点
func (*ContainerLayout) Background ¶
func (p *ContainerLayout) Background(r, g, b, a uint8) *ContainerLayout
背景颜色
func (*ContainerLayout) Layout ¶
func (p *ContainerLayout) Layout(gtx glayout.Context) (dimensions glayout.Dimensions)
渲染
func (*ContainerLayout) Margin ¶
func (p *ContainerLayout) Margin(Top, Left, Bottom, Right float32) *ContainerLayout
设置外边距
func (*ContainerLayout) RemoveChild ¶
func (p *ContainerLayout) RemoveChild() *ContainerLayout
删除子节点
func (*ContainerLayout) ResetParent ¶
func (p *ContainerLayout) ResetParent(child WidgetInterface)
重新设置父节点
func (*ContainerLayout) Then ¶
func (p *ContainerLayout) Then(fn func(self *ContainerLayout)) *ContainerLayout
绑定函数
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
编辑框
func (*Editor) ClearSelection ¶
清除选择区域,通过将选择区域的结束位置设定为开始位置
func (*Editor) GetSelection ¶
返回选择区域的开始和结束位置,开始的位置可以大于结束的位置
func (*Editor) KeyboardType ¶
设置屏幕键盘类型
func (*Editor) LineHeightScale ¶
设置文字行高缩放
func (*Editor) MoveCaret ¶
方法移动光标(也就是选择开始)和选择结束,相对于它们当前的位置。正距离向前移动,负距离向后移动。距离是以字形簇为单位,即使字符由多个代码点组成,这也非常接近用户所认为的"字符"。
func (*Editor) SelectionColor ¶
设置文本框选中部分的背景颜色
func (*Editor) WrapPolicy ¶
func (p *Editor) WrapPolicy(wrapPolicy text.WrapPolicy) *Editor
设置如何显示文本换行
type Label ¶ added in v0.0.2
type Label struct {
// contains filtered or unexported fields
}
func (*Label) Layout ¶ added in v0.0.2
func (p *Label) Layout(gtx glayout.Context) glayout.Dimensions
布局
func (*Label) LineHeight ¶ added in v0.0.2
设置文本行高
func (*Label) LineHeightScale ¶ added in v0.0.2
设置文本行高缩放
func (*Label) WrapPolicy ¶ added in v0.0.2
func (p *Label) WrapPolicy(wrapPolicy text.WrapPolicy) *Label
设置如何显示文本换行
type ListLayout ¶
type ListLayout struct {
// contains filtered or unexported fields
}
列表布局
func (*ListLayout) AppendChild ¶
func (p *ListLayout) AppendChild(child WidgetInterface) *ListLayout
添加子节点
func (*ListLayout) GetChildAt ¶
func (p *ListLayout) GetChildAt(index int) WidgetInterface
获取指定索引的子节点
func (*ListLayout) Layout ¶
func (p *ListLayout) Layout(gtx glayout.Context) glayout.Dimensions
渲染UI
func (*ListLayout) Margin ¶
func (p *ListLayout) Margin(Top, Left, Bottom, Right float32) *ListLayout
设置外边距
func (*ListLayout) RemoveChild ¶
func (p *ListLayout) RemoveChild(child WidgetInterface) *ListLayout
从组件中删除子节点
func (*ListLayout) RemoveChildAt ¶
func (p *ListLayout) RemoveChildAt(index int) *ListLayout
从指定索引删除子节点
func (*ListLayout) ScrollBgColor ¶
func (p *ListLayout) ScrollBgColor(r, g, b, a uint8) *ListLayout
滚动条背景颜色
func (*ListLayout) ScrollColor ¶
func (p *ListLayout) ScrollColor(r, g, b, a uint8) *ListLayout
滚动条鼠标默认颜色
func (*ListLayout) ScrollCornerRadius ¶
func (p *ListLayout) ScrollCornerRadius(radius float32) *ListLayout
滚动条的圆角
func (*ListLayout) ScrollHoverColor ¶
func (p *ListLayout) ScrollHoverColor(r, g, b, a uint8) *ListLayout
滚动条鼠标悬浮颜色
func (*ListLayout) ScrollMinLen ¶
func (p *ListLayout) ScrollMinLen(minLen float32) *ListLayout
滚动条最小长度
func (*ListLayout) ScrollPadding ¶
func (p *ListLayout) ScrollPadding(width, height float32) *ListLayout
滚动条的间距宽高
func (*ListLayout) ScrollPaddingEnable ¶
func (p *ListLayout) ScrollPaddingEnable(enable bool) *ListLayout
是否启用滚动条间距,如果禁用,滚动条会覆着在列表上
func (*ListLayout) ScrollToEnd ¶
func (p *ListLayout) ScrollToEnd(scrollToEnd bool) *ListLayout
当设置为true,会让列表在更新item后保持滚动到最后更新位置
func (*ListLayout) ScrollToItem ¶
func (p *ListLayout) ScrollToItem(index int) *ListLayout
滚动到列表中存在的指定项的位置
type MultiChildLayoutInterface ¶
type MultiChildLayoutInterface[T any] interface { WidgetInterface // 重新设置父节点 ResetParent(child WidgetInterface) // 外边距 Margin(Top, Left, Bottom, Right float32) T // 从指定索引删除子节点 RemoveChildAt(index int) T // 从组件删除子节点 RemoveChild(child WidgetInterface) T // 删除所有子节点 RemoveChildAll() T // 获取子节点 GetChildAll() []WidgetInterface // 获取指定索引的子节点 GetChildAt(index int) WidgetInterface // 获取子节点数量 GetChildCount() int }
多子节点布局接口
type RadioButtons ¶
type RadioButtons struct {
// contains filtered or unexported fields
}
复选框
func (*RadioButtons) AppendRadioButton ¶
func (p *RadioButtons) AppendRadioButton(key, text string) *RadioButtons
添加子节点
func (*RadioButtons) FontColor ¶
func (p *RadioButtons) FontColor(r, g, b, a uint8) *RadioButtons
设置文字颜色
func (*RadioButtons) Layout ¶
func (p *RadioButtons) Layout(gtx glayout.Context) glayout.Dimensions
重新设置父节点
func (*RadioButtons) Margin ¶
func (p *RadioButtons) Margin(Top, Left, Bottom, Right float32) *RadioButtons
外边距
func (*RadioButtons) OnFocused ¶
func (p *RadioButtons) OnFocused(fn func(p *RadioButtons, key string)) *RadioButtons
焦点事件
func (*RadioButtons) OnHovered ¶
func (p *RadioButtons) OnHovered(fn func(p *RadioButtons, key string)) *RadioButtons
鼠标悬浮事件
func (*RadioButtons) OnSelected ¶
func (p *RadioButtons) OnSelected(fn func(p *RadioButtons, key string)) *RadioButtons
选择事件
func (*RadioButtons) RadioMarkColor ¶
func (p *RadioButtons) RadioMarkColor(r, g, b, a uint8) *RadioButtons
设置单选框左边标记的颜色
func (*RadioButtons) Then ¶
func (p *RadioButtons) Then(fn func(self *RadioButtons)) *RadioButtons
绑定函数
type RowLayout ¶
func (*RowLayout) AppendFlexAnchorChild ¶
func (p *RowLayout) AppendFlexAnchorChild(weight float32, direction anchor.Direction, child WidgetInterface) *RowLayout
添加子节点,可以根据方向进行布局堆叠
func (*RowLayout) AppendFlexChild ¶
func (p *RowLayout) AppendFlexChild(weight float32, child WidgetInterface) *RowLayout
添加子节点,并且可以定义权重
func (*RowLayout) AppendRigidChild ¶
func (p *RowLayout) AppendRigidChild(child WidgetInterface) *RowLayout
添加子节点,组件得到基于子组件的固定空间
func (*RowLayout) RemoveChild ¶
func (p *RowLayout) RemoveChild(child WidgetInterface) *RowLayout
从组件删除子节点
func (*RowLayout) RemoveChildAt ¶
从指定索引删除子节点
type SingleChildLayoutInterface ¶
type SingleChildLayoutInterface[T any] interface { WidgetInterface // 重新设置父节点 ResetParent(child WidgetInterface) // 外边距 Margin(Top, Left, Bottom, Right float32) T // 设置子节点 AppendChild(childs WidgetInterface) T // 获取子节点 GetChild() WidgetInterface // 删除子节点 RemoveChild() T }
单子节点布局接口
type Slider ¶ added in v0.0.7
type Slider struct {
// contains filtered or unexported fields
}
func (*Slider) FingerSize ¶ added in v0.0.7
滑块可点击的范围
func (*Slider) Layout ¶ added in v0.0.7
func (p *Slider) Layout(gtx glayout.Context) glayout.Dimensions
渲染组件
func (*Slider) OnDragging ¶ added in v0.0.7
注册拖动事件
type Switch ¶ added in v0.0.2
type Switch struct {
// contains filtered or unexported fields
}
func (*Switch) DisabledColor ¶ added in v0.0.2
禁用颜色
func (*Switch) EnabledColor ¶ added in v0.0.2
启用颜色
func (*Switch) Layout ¶ added in v0.0.2
func (p *Switch) Layout(gtx glayout.Context) glayout.Dimensions
布局
func (*Switch) TrackColor ¶ added in v0.0.2
轨道颜色
type WidgetInterface ¶
type WidgetInterface interface { // 渲染UI Layout(gtx glayout.Context) glayout.Dimensions // 删除函数注册 OnDestroy(fn func()) // 删除组件 Destroy() // 是否更新组件 Update(update bool) }
定义一个通用的布局接口