Documentation ¶
Overview ¶
Package widget defines UI widgets for the Fyne GUI toolkit.
Index ¶
- type Badge
- type Slider
- type Switch
- func (w *Switch) CreateRenderer() fyne.WidgetRenderer
- func (w *Switch) Cursor() desktop.Cursor
- func (w *Switch) FocusGained()
- func (w *Switch) FocusLost()
- func (w *Switch) MinSize() fyne.Size
- func (w *Switch) MouseIn(me *desktop.MouseEvent)
- func (w *Switch) MouseMoved(me *desktop.MouseEvent)
- func (w *Switch) MouseOut()
- func (w *Switch) SetState(on bool)
- func (w *Switch) State() bool
- func (w *Switch) Tapped(pe *fyne.PointEvent)
- func (w *Switch) TappedSecondary(_ *fyne.PointEvent)
- func (w *Switch) TypedKey(key *fyne.KeyEvent)
- func (w *Switch) TypedRune(r rune)
- type TappableIcon
- type TappableImage
- func (w *TappableImage) CreateRenderer() fyne.WidgetRenderer
- func (w *TappableImage) Cursor() desktop.Cursor
- func (w *TappableImage) MouseIn(e *desktop.MouseEvent)
- func (w *TappableImage) MouseMoved(*desktop.MouseEvent)
- func (w *TappableImage) MouseOut()
- func (w *TappableImage) SetFillMode(fillMode canvas.ImageFill)
- func (w *TappableImage) SetMinSize(size fyne.Size)
- func (w *TappableImage) Tapped(_ *fyne.PointEvent)
- func (w *TappableImage) TappedSecondary(_ *fyne.PointEvent)
- type TappableLabel
- type Toggle
- func (w *Toggle) CreateRenderer() fyne.WidgetRenderer
- func (w *Toggle) Cursor() desktop.Cursor
- func (w *Toggle) FocusGained()
- func (w *Toggle) FocusLost()
- func (w *Toggle) MinSize() fyne.Size
- func (w *Toggle) MouseIn(e *desktop.MouseEvent)
- func (w *Toggle) MouseMoved(*desktop.MouseEvent)
- func (w *Toggle) MouseOut()
- func (w *Toggle) SetState(on bool)
- func (w *Toggle) Tapped(_ *fyne.PointEvent)
- func (w *Toggle) TappedSecondary(_ *fyne.PointEvent)
- func (w *Toggle) TypedKey(key *fyne.KeyEvent)
- func (w *Toggle) TypedRune(r rune)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Badge ¶
Badge is a variant of the Fyne label widget that renders a rounded box around the text. Badges are commonly used to display counts.
func (*Badge) CreateRenderer ¶
func (w *Badge) CreateRenderer() fyne.WidgetRenderer
type Slider ¶
type Slider struct { widget.BaseWidget OnChangeEnded func(float64) // contains filtered or unexported fields }
Slider is a variant of the Fyne Slider widget that also displays the current value.
func (*Slider) CreateRenderer ¶
func (w *Slider) CreateRenderer() fyne.WidgetRenderer
type Switch ¶
type Switch struct { widget.DisableableWidget OnChanged func(on bool) // contains filtered or unexported fields }
Switch is a widget representing a digital switch with two mutually exclusive states: on/off.
func (*Switch) CreateRenderer ¶
func (w *Switch) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer.
func (*Switch) FocusGained ¶
func (w *Switch) FocusGained()
FocusGained is called when the Check has been given focus.
func (*Switch) FocusLost ¶
func (w *Switch) FocusLost()
FocusLost is called when the Check has had focus removed.
func (*Switch) MinSize ¶
func (w *Switch) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*Switch) MouseIn ¶
func (w *Switch) MouseIn(me *desktop.MouseEvent)
MouseIn is a hook that is called if the mouse pointer enters the element.
func (*Switch) MouseMoved ¶
func (w *Switch) MouseMoved(me *desktop.MouseEvent)
MouseMoved is called when a desktop pointer hovers over the widget
func (*Switch) Tapped ¶
func (w *Switch) Tapped(pe *fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any change handler
func (*Switch) TappedSecondary ¶
func (w *Switch) TappedSecondary(_ *fyne.PointEvent)
type TappableIcon ¶
type TappableIcon struct { *widget.Icon // The function that is called when the icon is tapped. OnTapped func() // contains filtered or unexported fields }
TappableIcon is an icon widget, which runs a function when tapped.
func NewTappableIcon ¶
func NewTappableIcon(res fyne.Resource, tapped func()) *TappableIcon
NewTappableIcon returns a new instance of a TappableIcon widget.
func (*TappableIcon) Cursor ¶
func (w *TappableIcon) Cursor() desktop.Cursor
Cursor returns the cursor type of this widget
func (*TappableIcon) MouseIn ¶
func (w *TappableIcon) MouseIn(e *desktop.MouseEvent)
MouseIn is a hook that is called if the mouse pointer enters the element.
func (*TappableIcon) MouseMoved ¶
func (w *TappableIcon) MouseMoved(*desktop.MouseEvent)
func (*TappableIcon) MouseOut ¶
func (w *TappableIcon) MouseOut()
MouseOut is a hook that is called if the mouse pointer leaves the element.
func (*TappableIcon) Tapped ¶
func (w *TappableIcon) Tapped(_ *fyne.PointEvent)
func (*TappableIcon) TappedSecondary ¶
func (w *TappableIcon) TappedSecondary(_ *fyne.PointEvent)
type TappableImage ¶
type TappableImage struct { widget.BaseWidget // The function that is called when the label is tapped. OnTapped func() // contains filtered or unexported fields }
TappableImage is widget which shows an image and runs a function when tapped.
func NewTappableImage ¶
func NewTappableImage(res fyne.Resource, tapped func()) *TappableImage
NewTappableImage returns a new instance of a TappableImage widget.
func (*TappableImage) CreateRenderer ¶
func (w *TappableImage) CreateRenderer() fyne.WidgetRenderer
func (*TappableImage) Cursor ¶
func (w *TappableImage) Cursor() desktop.Cursor
Cursor returns the cursor type of this widget
func (*TappableImage) MouseIn ¶
func (w *TappableImage) MouseIn(e *desktop.MouseEvent)
MouseIn is a hook that is called if the mouse pointer enters the element.
func (*TappableImage) MouseMoved ¶
func (w *TappableImage) MouseMoved(*desktop.MouseEvent)
func (*TappableImage) MouseOut ¶
func (w *TappableImage) MouseOut()
MouseOut is a hook that is called if the mouse pointer leaves the element.
func (*TappableImage) SetFillMode ¶
func (w *TappableImage) SetFillMode(fillMode canvas.ImageFill)
SetFillMode sets the fill mode of the image.
func (*TappableImage) SetMinSize ¶
func (w *TappableImage) SetMinSize(size fyne.Size)
SetMinSize sets the minimum size of the image.
func (*TappableImage) Tapped ¶
func (w *TappableImage) Tapped(_ *fyne.PointEvent)
func (*TappableImage) TappedSecondary ¶
func (w *TappableImage) TappedSecondary(_ *fyne.PointEvent)
type TappableLabel ¶
type TappableLabel struct { *widget.Label // The function that is called when the label is tapped. OnTapped func() // contains filtered or unexported fields }
TappableLabel is a variant of the Fyne Label which runs a function when tapped.
func NewTappableLabel ¶
func NewTappableLabel(text string, tapped func()) *TappableLabel
NewTappableLabel returns a new TappableLabel instance.
func (*TappableLabel) Cursor ¶
func (w *TappableLabel) Cursor() desktop.Cursor
Cursor returns the cursor type of this widget
func (*TappableLabel) MouseIn ¶
func (w *TappableLabel) MouseIn(e *desktop.MouseEvent)
MouseIn is a hook that is called if the mouse pointer enters the element.
func (*TappableLabel) MouseMoved ¶
func (w *TappableLabel) MouseMoved(*desktop.MouseEvent)
func (*TappableLabel) MouseOut ¶
func (w *TappableLabel) MouseOut()
MouseOut is a hook that is called if the mouse pointer leaves the element.
func (*TappableLabel) Tapped ¶
func (w *TappableLabel) Tapped(_ *fyne.PointEvent)
type Toggle ¶
type Toggle struct { widget.DisableableWidget OnChanged func(on bool) On bool // contains filtered or unexported fields }
Toggle is a widget implementing a digital switch with two mutually exclusive states: on/off.
func (*Toggle) CreateRenderer ¶
func (w *Toggle) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer.
func (*Toggle) FocusGained ¶
func (w *Toggle) FocusGained()
FocusGained is called when the Check has been given focus.
func (*Toggle) FocusLost ¶
func (w *Toggle) FocusLost()
FocusLost is called when the Check has had focus removed.
func (*Toggle) MinSize ¶
func (w *Toggle) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*Toggle) MouseIn ¶
func (w *Toggle) MouseIn(e *desktop.MouseEvent)
MouseIn is a hook that is called if the mouse pointer enters the element.
func (*Toggle) MouseMoved ¶
func (w *Toggle) MouseMoved(*desktop.MouseEvent)
MouseMoved is called when a desktop pointer hovers over the widget
func (*Toggle) MouseOut ¶
func (w *Toggle) MouseOut()
MouseOut is a hook that is called if the mouse pointer leaves the element.
func (*Toggle) Tapped ¶
func (w *Toggle) Tapped(_ *fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any change handler
func (*Toggle) TappedSecondary ¶
func (w *Toggle) TappedSecondary(_ *fyne.PointEvent)