package widget
import "fyne.io/fyne/widget"
Package widget defines the UI widgets within the Fyne toolkit
Index ¶
- func DestroyRenderer(wid fyne.Widget)
- func Refresh(wid fyne.Widget)
- func Renderer(wid fyne.Widget) fyne.WidgetRenderer
- type BaseWidget
- func (w *BaseWidget) CreateRenderer() fyne.WidgetRenderer
- func (w *BaseWidget) ExtendBaseWidget(wid fyne.Widget)
- func (w *BaseWidget) Hide()
- func (w *BaseWidget) MinSize() fyne.Size
- func (w *BaseWidget) Move(pos fyne.Position)
- func (w *BaseWidget) Position() fyne.Position
- func (w *BaseWidget) Refresh()
- func (w *BaseWidget) Resize(size fyne.Size)
- func (w *BaseWidget) Show()
- func (w *BaseWidget) Size() fyne.Size
- func (w *BaseWidget) Visible() bool
- type Box
- func NewHBox(children ...fyne.CanvasObject) *Box
- func NewVBox(children ...fyne.CanvasObject) *Box
- func (b *Box) Append(object fyne.CanvasObject)
- func (b *Box) CreateRenderer() fyne.WidgetRenderer
- func (b *Box) MinSize() fyne.Size
- func (b *Box) Prepend(object fyne.CanvasObject)
- func (b *Box) Refresh()
- type Button
- func NewButton(label string, tapped func()) *Button
- func NewButtonWithIcon(label string, icon fyne.Resource, tapped func()) *Button
- func (b *Button) CreateRenderer() fyne.WidgetRenderer
- func (b *Button) MinSize() fyne.Size
- func (b *Button) MouseIn(*desktop.MouseEvent)
- func (b *Button) MouseMoved(*desktop.MouseEvent)
- func (b *Button) MouseOut()
- func (b *Button) SetIcon(icon fyne.Resource)
- func (b *Button) SetText(text string)
- func (b *Button) Tapped(*fyne.PointEvent)
- func (b *Button) TappedSecondary(*fyne.PointEvent)
- type ButtonStyle
- type Check
- func NewCheck(label string, changed func(bool)) *Check
- func (c *Check) CreateRenderer() fyne.WidgetRenderer
- func (c *Check) FocusGained()
- func (c *Check) FocusLost()
- func (c *Check) Focused() bool
- func (c *Check) Hide()
- func (c *Check) MinSize() fyne.Size
- func (c *Check) MouseIn(*desktop.MouseEvent)
- func (c *Check) MouseMoved(*desktop.MouseEvent)
- func (c *Check) MouseOut()
- func (c *Check) SetChecked(checked bool)
- func (c *Check) Tapped(*fyne.PointEvent)
- func (c *Check) TappedSecondary(*fyne.PointEvent)
- func (c *Check) TypedKey(key *fyne.KeyEvent)
- func (c *Check) TypedRune(r rune)
- type DisableableWidget
- func (w *DisableableWidget) Disable()
- func (w *DisableableWidget) Disabled() bool
- func (w *DisableableWidget) Enable()
- type Entry
- func NewEntry() *Entry
- func NewMultiLineEntry() *Entry
- func NewPasswordEntry() *Entry
- func (e *Entry) CreateRenderer() fyne.WidgetRenderer
- func (e *Entry) Disable()
- func (e *Entry) DoubleTapped(ev *fyne.PointEvent)
- func (e *Entry) DragEnd()
- func (e *Entry) Dragged(d *fyne.DragEvent)
- func (e *Entry) Enable()
- func (e *Entry) FocusGained()
- func (e *Entry) FocusLost()
- func (e *Entry) Focused() bool
- func (e *Entry) KeyDown(key *fyne.KeyEvent)
- func (e *Entry) KeyUp(key *fyne.KeyEvent)
- func (e *Entry) MinSize() fyne.Size
- func (e *Entry) MouseDown(m *desktop.MouseEvent)
- func (e *Entry) MouseUp(m *desktop.MouseEvent)
- func (e *Entry) SetPlaceHolder(text string)
- func (e *Entry) SetReadOnly(ro bool)
- func (e *Entry) SetText(text string)
- func (e *Entry) Tapped(ev *fyne.PointEvent)
- func (e *Entry) TappedSecondary(pe *fyne.PointEvent)
- func (e *Entry) TypedKey(key *fyne.KeyEvent)
- func (e *Entry) TypedRune(r rune)
- func (e *Entry) TypedShortcut(shortcut fyne.Shortcut) bool
- type Form
- func NewForm(items ...*FormItem) *Form
- func (f *Form) Append(text string, widget fyne.CanvasObject)
- func (f *Form) AppendItem(item *FormItem)
- func (f *Form) CreateRenderer() fyne.WidgetRenderer
- func (f *Form) MinSize() fyne.Size
- type FormItem
- type Group
- func NewGroup(title string, children ...fyne.CanvasObject) *Group
- func NewGroupWithScroller(title string, children ...fyne.CanvasObject) *Group
- func (g *Group) Append(object fyne.CanvasObject)
- func (g *Group) CreateRenderer() fyne.WidgetRenderer
- func (g *Group) MinSize() fyne.Size
- func (g *Group) Prepend(object fyne.CanvasObject)
- type Hyperlink
- func NewHyperlink(text string, url *url.URL) *Hyperlink
- func NewHyperlinkWithStyle(text string, url *url.URL, alignment fyne.TextAlign, style fyne.TextStyle) *Hyperlink
- func (hl *Hyperlink) CreateRenderer() fyne.WidgetRenderer
- func (hl *Hyperlink) MinSize() fyne.Size
- func (hl *Hyperlink) SetText(text string)
- func (hl *Hyperlink) SetURL(url *url.URL)
- func (hl *Hyperlink) SetURLFromString(str string) error
- func (t *Hyperlink) String() string
- func (hl *Hyperlink) Tapped(*fyne.PointEvent)
- func (hl *Hyperlink) TappedSecondary(*fyne.PointEvent)
- type Icon
- func NewIcon(res fyne.Resource) *Icon
- func (i *Icon) CreateRenderer() fyne.WidgetRenderer
- func (i *Icon) MinSize() fyne.Size
- func (i *Icon) SetResource(res fyne.Resource)
- type Label
- func NewLabel(text string) *Label
- func NewLabelWithStyle(text string, alignment fyne.TextAlign, style fyne.TextStyle) *Label
- func (l *Label) CreateRenderer() fyne.WidgetRenderer
- func (l *Label) MinSize() fyne.Size
- func (l *Label) SetText(text string)
- func (t *Label) String() string
- type Orientation
- type PopUp
- func NewModalPopUp(content fyne.CanvasObject, canvas fyne.Canvas) *PopUp
- func NewPopUp(content fyne.CanvasObject, canvas fyne.Canvas) *PopUp
- func NewPopUpAtPosition(content fyne.CanvasObject, canvas fyne.Canvas, pos fyne.Position) *PopUp
- func NewPopUpMenu(menu *fyne.Menu, c fyne.Canvas) *PopUp
- func NewPopUpMenuAtPosition(menu *fyne.Menu, c fyne.Canvas, pos fyne.Position) *PopUp
- func (p *PopUp) CreateRenderer() fyne.WidgetRenderer
- func (p *PopUp) Hide()
- func (p *PopUp) MinSize() fyne.Size
- func (p *PopUp) Move(pos fyne.Position)
- func (p *PopUp) Resize(size fyne.Size)
- func (p *PopUp) Show()
- func (p *PopUp) Tapped(_ *fyne.PointEvent)
- func (p *PopUp) TappedSecondary(_ *fyne.PointEvent)
- type ProgressBar
- func NewProgressBar() *ProgressBar
- func (p *ProgressBar) CreateRenderer() fyne.WidgetRenderer
- func (p *ProgressBar) MinSize() fyne.Size
- func (p *ProgressBar) SetValue(v float64)
- type ProgressBarInfinite
- func NewProgressBarInfinite() *ProgressBarInfinite
- func (p *ProgressBarInfinite) CreateRenderer() fyne.WidgetRenderer
- func (p *ProgressBarInfinite) Hide()
- func (p *ProgressBarInfinite) MinSize() fyne.Size
- func (p *ProgressBarInfinite) Running() bool
- func (p *ProgressBarInfinite) Show()
- func (p *ProgressBarInfinite) Start()
- func (p *ProgressBarInfinite) Stop()
- type Radio
- func NewRadio(options []string, changed func(string)) *Radio
- func (r *Radio) Append(option string)
- func (r *Radio) CreateRenderer() fyne.WidgetRenderer
- func (r *Radio) MinSize() fyne.Size
- func (r *Radio) MouseIn(event *desktop.MouseEvent)
- func (r *Radio) MouseMoved(event *desktop.MouseEvent)
- func (r *Radio) MouseOut()
- func (r *Radio) SetSelected(option string)
- func (r *Radio) Tapped(event *fyne.PointEvent)
- func (r *Radio) TappedSecondary(*fyne.PointEvent)
- type ScrollContainer
- func NewScrollContainer(content fyne.CanvasObject) *ScrollContainer
- func (s *ScrollContainer) CreateRenderer() fyne.WidgetRenderer
- func (s *ScrollContainer) DragEnd()
- func (s *ScrollContainer) Dragged(e *fyne.DragEvent)
- func (s *ScrollContainer) MinSize() fyne.Size
- func (s *ScrollContainer) Refresh()
- func (s *ScrollContainer) Resize(size fyne.Size)
- func (s *ScrollContainer) Scrolled(ev *fyne.ScrollEvent)
- type Select
- func NewSelect(options []string, changed func(string)) *Select
- func (s *Select) CreateRenderer() fyne.WidgetRenderer
- func (s *Select) MinSize() fyne.Size
- func (s *Select) MouseIn(*desktop.MouseEvent)
- func (s *Select) MouseMoved(*desktop.MouseEvent)
- func (s *Select) MouseOut()
- func (s *Select) Resize(size fyne.Size)
- func (s *Select) SetSelected(text string)
- func (s *Select) Tapped(*fyne.PointEvent)
- func (s *Select) TappedSecondary(*fyne.PointEvent)
- type Slider
- func NewSlider(min, max float64) *Slider
- func (s *Slider) CreateRenderer() fyne.WidgetRenderer
- func (s *Slider) DragEnd()
- func (s *Slider) Dragged(e *fyne.DragEvent)
- func (s *Slider) MinSize() fyne.Size
- type TabContainer
- func NewTabContainer(items ...*TabItem) *TabContainer
- func (t *TabContainer) Append(item *TabItem)
- func (t *TabContainer) CreateRenderer() fyne.WidgetRenderer
- func (t *TabContainer) CurrentTab() *TabItem
- func (t *TabContainer) CurrentTabIndex() int
- func (t *TabContainer) MinSize() fyne.Size
- func (t *TabContainer) Remove(item *TabItem)
- func (t *TabContainer) RemoveIndex(index int)
- func (t *TabContainer) SelectTab(item *TabItem)
- func (t *TabContainer) SelectTabIndex(index int)
- func (t *TabContainer) SetTabLocation(l TabLocation)
- func (t *TabContainer) Show()
- type TabItem
- func NewTabItem(text string, content fyne.CanvasObject) *TabItem
- func NewTabItemWithIcon(text string, icon fyne.Resource, content fyne.CanvasObject) *TabItem
- type TabLocation
- type Toolbar
- func NewToolbar(items ...ToolbarItem) *Toolbar
- func (t *Toolbar) Append(item ToolbarItem)
- func (t *Toolbar) CreateRenderer() fyne.WidgetRenderer
- func (t *Toolbar) MinSize() fyne.Size
- func (t *Toolbar) Prepend(item ToolbarItem)
- type ToolbarAction
- type ToolbarItem
- func NewToolbarAction(icon fyne.Resource, onActivated func()) ToolbarItem
- func NewToolbarSeparator() ToolbarItem
- func NewToolbarSpacer() ToolbarItem
- type ToolbarSeparator
- type ToolbarSpacer
Functions ¶
func DestroyRenderer ¶
DestroyRenderer frees a render implementation for a widget. This is typically for internal use only. Deprecated: Access to widget renderers is being removed, render details should be private to a WidgetRenderer.
func Refresh ¶
Refresh instructs the containing canvas to refresh the specified widget. Deprecated: Call Widget.Refresh() instead.
func Renderer ¶
func Renderer(wid fyne.Widget) fyne.WidgetRenderer
Renderer looks up the render implementation for a widget Deprecated: Access to widget renderers is being removed, render details should be private to a WidgetRenderer.
Types ¶
type BaseWidget ¶
type BaseWidget struct { Hidden bool // contains filtered or unexported fields }
BaseWidget provides a helper that handles basic widget behaviours.
func (*BaseWidget) CreateRenderer ¶
func (w *BaseWidget) CreateRenderer() fyne.WidgetRenderer
CreateRenderer of BaseWidget does nothing, it must be overridden
func (*BaseWidget) ExtendBaseWidget ¶
func (w *BaseWidget) ExtendBaseWidget(wid fyne.Widget)
ExtendBaseWidget is used by an extending widget to make use of BaseWidget functionality.
func (*BaseWidget) Hide ¶
func (w *BaseWidget) Hide()
Hide this widget so it is no lonver visible
func (*BaseWidget) MinSize ¶
func (w *BaseWidget) MinSize() fyne.Size
MinSize for the widget - it should never be resized below this value.
func (*BaseWidget) Move ¶
func (w *BaseWidget) Move(pos fyne.Position)
Move the widget to a new position, relative to its parent. Note this should not be used if the widget is being managed by a Layout within a Container.
func (*BaseWidget) Position ¶
func (w *BaseWidget) Position() fyne.Position
Position gets the current position of this widget, relative to its parent.
func (*BaseWidget) Refresh ¶
func (w *BaseWidget) Refresh()
Refresh causes this widget to be redrawn in it's current state
func (*BaseWidget) Resize ¶
func (w *BaseWidget) Resize(size fyne.Size)
Resize sets a new size for a widget. Note this should not be used if the widget is being managed by a Layout within a Container.
func (*BaseWidget) Show ¶
func (w *BaseWidget) Show()
Show this widget so it becomes visible
func (*BaseWidget) Size ¶
func (w *BaseWidget) Size() fyne.Size
Size gets the current size of this widget.
func (*BaseWidget) Visible ¶
func (w *BaseWidget) Visible() bool
Visible returns whether or not this widget should be visible. Note that this may not mean it is currently visible if a parent has been hidden.
type Box ¶
type Box struct { BaseWidget Horizontal bool Children []fyne.CanvasObject // contains filtered or unexported fields }
Box widget is a simple list where the child elements are arranged in a single column for vertical or a single row for horizontal arrangement
func NewHBox ¶
func NewHBox(children ...fyne.CanvasObject) *Box
NewHBox creates a new horizontally aligned box widget with the specified list of child objects
func NewVBox ¶
func NewVBox(children ...fyne.CanvasObject) *Box
NewVBox creates a new vertically aligned box widget with the specified list of child objects
func (*Box) Append ¶
func (b *Box) Append(object fyne.CanvasObject)
Append adds a new CanvasObject to the end/right of the box
func (*Box) CreateRenderer ¶
func (b *Box) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Box) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Box) Prepend ¶
func (b *Box) Prepend(object fyne.CanvasObject)
Prepend inserts a new CanvasObject at the top/left of the box
func (*Box) Refresh ¶
func (b *Box) Refresh()
Refresh updates this box to match the current theme
type Button ¶
type Button struct { DisableableWidget Text string Style ButtonStyle Icon fyne.Resource OnTapped func() `json:"-"` HideShadow bool // contains filtered or unexported fields }
Button widget has a text label and triggers an event func when clicked
func NewButton ¶
NewButton creates a new button widget with the set label and tap handler
func NewButtonWithIcon ¶
NewButtonWithIcon creates a new button widget with the specified label, themed icon and tap handler
func (*Button) CreateRenderer ¶
func (b *Button) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Button) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Button) MouseIn ¶
func (b *Button) MouseIn(*desktop.MouseEvent)
MouseIn is called when a desktop pointer enters the widget
func (*Button) MouseMoved ¶
func (b *Button) MouseMoved(*desktop.MouseEvent)
MouseMoved is called when a desktop pointer hovers over the widget
func (*Button) MouseOut ¶
func (b *Button) MouseOut()
MouseOut is called when a desktop pointer exits the widget
func (*Button) SetIcon ¶
SetIcon updates the icon on a label - pass nil to hide an icon
func (*Button) SetText ¶
SetText allows the button label to be changed
func (*Button) Tapped ¶
func (b *Button) Tapped(*fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any tap handler
func (*Button) TappedSecondary ¶
func (b *Button) TappedSecondary(*fyne.PointEvent)
TappedSecondary is called when a secondary pointer tapped event is captured
type ButtonStyle ¶
type ButtonStyle int
ButtonStyle determines the behaviour and rendering of a button.
const ( // DefaultButton is the standard button style DefaultButton ButtonStyle = iota // PrimaryButton that should be more prominent to the user PrimaryButton )
type Check ¶
type Check struct { DisableableWidget Text string Checked bool OnChanged func(bool) `json:"-"` // contains filtered or unexported fields }
Check widget has a text label and a checked (or unchecked) icon and triggers an event func when toggled
func NewCheck ¶
NewCheck creates a new check widget with the set label and change handler
func (*Check) CreateRenderer ¶
func (c *Check) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Check) FocusGained ¶
func (c *Check) FocusGained()
FocusGained is called when the Check has been given focus.
func (*Check) FocusLost ¶
func (c *Check) FocusLost()
FocusLost is called when the Check has had focus removed.
func (*Check) Focused ¶
Focused returns whether or not this Check has focus.
func (*Check) Hide ¶
func (c *Check) Hide()
Hide this widget, if it was previously visible
func (*Check) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Check) MouseIn ¶
func (c *Check) MouseIn(*desktop.MouseEvent)
MouseIn is called when a desktop pointer enters the widget
func (*Check) MouseMoved ¶
func (c *Check) MouseMoved(*desktop.MouseEvent)
MouseMoved is called when a desktop pointer hovers over the widget
func (*Check) MouseOut ¶
func (c *Check) MouseOut()
MouseOut is called when a desktop pointer exits the widget
func (*Check) SetChecked ¶
SetChecked sets the the checked state and refreshes widget
func (*Check) Tapped ¶
func (c *Check) Tapped(*fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any change handler
func (*Check) TappedSecondary ¶
func (c *Check) TappedSecondary(*fyne.PointEvent)
TappedSecondary is called when a secondary pointer tapped event is captured
func (*Check) TypedKey ¶
TypedKey receives key input events when the Check is focused.
func (*Check) TypedRune ¶
TypedRune receives text input events when the Check is focused.
type DisableableWidget ¶
type DisableableWidget struct { BaseWidget // contains filtered or unexported fields }
DisableableWidget describes an extension to BaseWidget which can be disabled. Disabled widgets should have a visually distinct style when disabled, normally using theme.DisabledButtonColor.
func (*DisableableWidget) Disable ¶
func (w *DisableableWidget) Disable()
Disable this widget so that it cannot be interacted with, updating any style appropriately.
func (*DisableableWidget) Disabled ¶
func (w *DisableableWidget) Disabled() bool
Disabled returns true if this widget is currently disabled or false if it can currently be interacted with.
func (*DisableableWidget) Enable ¶
func (w *DisableableWidget) Enable()
Enable this widget, updating any style or features appropriately.
type Entry ¶
type Entry struct { DisableableWidget sync.RWMutex Text string PlaceHolder string OnChanged func(string) `json:"-"` Password bool ReadOnly bool // Deprecated: Use Disable() instead MultiLine bool CursorRow, CursorColumn int OnCursorChanged func() `json:"-"` // contains filtered or unexported fields }
Entry widget allows simple text to be input when focused.
func NewEntry ¶
func NewEntry() *Entry
NewEntry creates a new single line entry widget.
func NewMultiLineEntry ¶
func NewMultiLineEntry() *Entry
NewMultiLineEntry creates a new entry that allows multiple lines
func NewPasswordEntry ¶
func NewPasswordEntry() *Entry
NewPasswordEntry creates a new entry password widget
func (*Entry) CreateRenderer ¶
func (e *Entry) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Entry) Disable ¶
func (e *Entry) Disable()
Disable this widget so that it cannot be interacted with, updating any style appropriately.
func (*Entry) DoubleTapped ¶
func (e *Entry) DoubleTapped(ev *fyne.PointEvent)
DoubleTapped is called when this entry has been double tapped so we should select text below the pointer
func (*Entry) DragEnd ¶
func (e *Entry) DragEnd()
DragEnd is called at end of a drag event - currently ignored
func (*Entry) Dragged ¶
Dragged is called when the pointer moves while a button is held down
func (*Entry) Enable ¶
func (e *Entry) Enable()
Enable this widget, updating any style or features appropriately.
func (*Entry) FocusGained ¶
func (e *Entry) FocusGained()
FocusGained is called when the Entry has been given focus.
func (*Entry) FocusLost ¶
func (e *Entry) FocusLost()
FocusLost is called when the Entry has had focus removed.
func (*Entry) Focused ¶
Focused returns whether or not this Entry has focus.
func (*Entry) KeyDown ¶
KeyDown handler for keypress events - used to store shift modifier state for text selection
func (*Entry) KeyUp ¶
KeyUp handler for key release events - used to reset shift modifier state for text selection
func (*Entry) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Entry) MouseDown ¶
func (e *Entry) MouseDown(m *desktop.MouseEvent)
MouseDown called on mouse click, this triggers a mouse click which can move the cursor, update the existing selection (if shift is held), or start a selection dragging operation.
func (*Entry) MouseUp ¶
func (e *Entry) MouseUp(m *desktop.MouseEvent)
MouseUp called on mouse release If a mouse drag event has completed then check to see if it has resulted in an empty selection, if so, and if a text select key isn't held, then disable selecting
func (*Entry) SetPlaceHolder ¶
SetPlaceHolder sets the text that will be displayed if the entry is otherwise empty
func (*Entry) SetReadOnly ¶
SetReadOnly sets whether or not the Entry should not be editable Deprecated: Use Disable() instead.
func (*Entry) SetText ¶
SetText manually sets the text of the Entry to the given text value.
func (*Entry) Tapped ¶
func (e *Entry) Tapped(ev *fyne.PointEvent)
Tapped is called when this entry has been tapped so we should update the cursor position.
func (*Entry) TappedSecondary ¶
func (e *Entry) TappedSecondary(pe *fyne.PointEvent)
TappedSecondary is called when right or alternative tap is invoked.
Opens the PopUpMenu with `Paste` item to paste text from the clipboard.
func (*Entry) TypedKey ¶
TypedKey receives key input events when the Entry widget is focused.
func (*Entry) TypedRune ¶
TypedRune receives text input events when the Entry widget is focused.
func (*Entry) TypedShortcut ¶
TypedShortcut implements the Shortcutable interface
type Form ¶
type Form struct { BaseWidget Items []*FormItem OnSubmit func() OnCancel func() // contains filtered or unexported fields }
Form widget is two column grid where each row has a label and a widget (usually an input). The last row of the grid will contain the appropriate form control buttons if any should be shown. Setting OnSubmit will set the submit button to be visible and call back the function when tapped. Setting OnCancel will do the same for a cancel button.
func NewForm ¶
NewForm creates a new form widget with the specified rows of form items and (if any of them should be shown) a form controls row at the bottom
func (*Form) Append ¶
func (f *Form) Append(text string, widget fyne.CanvasObject)
Append adds a new row to the form, using the text as a label next to the specified Widget
func (*Form) AppendItem ¶
AppendItem adds the specified row to the end of the Form
func (*Form) CreateRenderer ¶
func (f *Form) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Form) MinSize ¶
MinSize returns the size that this widget should not shrink below
type FormItem ¶
type FormItem struct { Text string Widget fyne.CanvasObject }
FormItem provides the details for a row in a form
func NewFormItem ¶
func NewFormItem(text string, widget fyne.CanvasObject) *FormItem
NewFormItem creates a new form item with the specified label text and input widget
type Group ¶
type Group struct { BaseWidget Text string // contains filtered or unexported fields }
Group widget is list of widgets that contains a visual border around the list and a group title at the top.
func NewGroup ¶
func NewGroup(title string, children ...fyne.CanvasObject) *Group
NewGroup creates a new grouped list widget with a title and the specified list of child objects.
func NewGroupWithScroller ¶
func NewGroupWithScroller(title string, children ...fyne.CanvasObject) *Group
NewGroupWithScroller creates a new grouped list widget with a title and the specified list of child objects. This group will scroll when the available space is less than needed to display the items it contains.
func (*Group) Append ¶
func (g *Group) Append(object fyne.CanvasObject)
Append adds a new CanvasObject to the end of the group
func (*Group) CreateRenderer ¶
func (g *Group) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Group) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Group) Prepend ¶
func (g *Group) Prepend(object fyne.CanvasObject)
Prepend inserts a new CanvasObject at the top of the group
type Hyperlink ¶
type Hyperlink struct { Text string URL *url.URL Alignment fyne.TextAlign // The alignment of the Text TextStyle fyne.TextStyle // The style of the hyperlink text // contains filtered or unexported fields }
Hyperlink widget is a text component with appropriate padding and layout. When clicked, the default web browser should open with a URL
func NewHyperlink ¶
NewHyperlink creates a new hyperlink widget with the set text content
func NewHyperlinkWithStyle ¶
func NewHyperlinkWithStyle(text string, url *url.URL, alignment fyne.TextAlign, style fyne.TextStyle) *Hyperlink
NewHyperlinkWithStyle creates a new hyperlink widget with the set text content
func (*Hyperlink) CreateRenderer ¶
func (hl *Hyperlink) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Hyperlink) MinSize ¶
MinSize returns the smallest size this widget can shrink to
func (*Hyperlink) SetText ¶
SetText sets the text of the hyperlink
func (*Hyperlink) SetURL ¶
SetURL sets the URL of the hyperlink, taking in a URL type
func (*Hyperlink) SetURLFromString ¶
SetURLFromString sets the URL of the hyperlink, taking in a string type
func (*Hyperlink) String ¶
func (t *Hyperlink) String() string
String returns the text widget buffer as string
func (*Hyperlink) Tapped ¶
func (hl *Hyperlink) Tapped(*fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any change handler
func (*Hyperlink) TappedSecondary ¶
func (hl *Hyperlink) TappedSecondary(*fyne.PointEvent)
TappedSecondary is called when a secondary pointer tapped event is captured
type Icon ¶
type Icon struct { BaseWidget Resource fyne.Resource // The resource for this icon }
Icon widget is a basic image component that load's its resource to match the theme.
func NewIcon ¶
NewIcon returns a new icon widget that displays a themed icon resource
func (*Icon) CreateRenderer ¶
func (i *Icon) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Icon) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Icon) SetResource ¶
SetResource updates the resource rendered in this icon widget
type Label ¶
type Label struct { Text string Alignment fyne.TextAlign // The alignment of the Text TextStyle fyne.TextStyle // The style of the label text // contains filtered or unexported fields }
Label widget is a label component with appropriate padding and layout.
func NewLabel ¶
NewLabel creates a new label widget with the set text content
func NewLabelWithStyle ¶
NewLabelWithStyle creates a new label widget with the set text content
func (*Label) CreateRenderer ¶
func (l *Label) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Label) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Label) SetText ¶
SetText sets the text of the label
func (*Label) String ¶
func (t *Label) String() string
String returns the text widget buffer as string
type Orientation ¶
type Orientation int
Orientation controls the horizontal/vertical layout of a widget
const ( Horizontal Orientation = 0 Vertical Orientation = 1 )
Orientation constants to control widget layout
type PopUp ¶
type PopUp struct { BaseWidget Content fyne.CanvasObject Canvas fyne.Canvas // contains filtered or unexported fields }
PopUp is a widget that can float above the user interface. It wraps any standard elements with padding and a shadow. If it is modal then the shadow will cover the entire canvas it hovers over and block interactions.
func NewModalPopUp ¶
func NewModalPopUp(content fyne.CanvasObject, canvas fyne.Canvas) *PopUp
NewModalPopUp creates a new popUp for the specified content and displays it on the passed canvas. A modal PopUp blocks interactions with underlying elements, covered with a semi-transparent overlay.
func NewPopUp ¶
func NewPopUp(content fyne.CanvasObject, canvas fyne.Canvas) *PopUp
NewPopUp creates a new popUp for the specified content and displays it on the passed canvas.
func NewPopUpAtPosition ¶
NewPopUpAtPosition creates a new popUp for the specified content at the specified absolute position. It will then display the popup it on the passed canvas.
func NewPopUpMenu ¶
NewPopUpMenu creates a PopUp widget populated with menu items from the passed menu structure. It will automatically be shown as an overlay on the specified canvas.
func NewPopUpMenuAtPosition ¶
NewPopUpMenuAtPosition creates a PopUp widget populated with menu items from the passed menu structure. It will automatically be positioned at the provided location and shown as an overlay on the specified canvas.
func (*PopUp) CreateRenderer ¶
func (p *PopUp) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*PopUp) Hide ¶
func (p *PopUp) Hide()
Hide this widget, if it was previously visible
func (*PopUp) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*PopUp) Move ¶
Move the widget to a new position. A PopUp position is absolute to the top, left of its canvas. For PopUp this actually moves the content so checking Position() will not return the same value as is set here.
func (*PopUp) Resize ¶
Resize sets a new size for a widget. Most PopUp widgets are shown at MinSize.
func (*PopUp) Show ¶
func (p *PopUp) Show()
Show this widget, if it was previously hidden
func (*PopUp) Tapped ¶
func (p *PopUp) Tapped(_ *fyne.PointEvent)
Tapped is called when the user taps the popUp background - if not modal then dismiss this widget
func (*PopUp) TappedSecondary ¶
func (p *PopUp) TappedSecondary(_ *fyne.PointEvent)
TappedSecondary is called when the user right/alt taps the background - if not modal then dismiss this widget
type ProgressBar ¶
type ProgressBar struct { BaseWidget Min, Max, Value float64 }
ProgressBar widget creates a horizontal panel that indicates progress
func NewProgressBar ¶
func NewProgressBar() *ProgressBar
NewProgressBar creates a new progress bar widget. The default Min is 0 and Max is 1, Values set should be between those numbers. The display will convert this to a percentage.
func (*ProgressBar) CreateRenderer ¶
func (p *ProgressBar) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*ProgressBar) MinSize ¶
func (p *ProgressBar) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*ProgressBar) SetValue ¶
func (p *ProgressBar) SetValue(v float64)
SetValue changes the current value of this progress bar (from p.Min to p.Max). The widget will be refreshed to indicate the change.
type ProgressBarInfinite ¶
type ProgressBarInfinite struct { BaseWidget }
ProgressBarInfinite widget creates a horizontal panel that indicates waiting indefinitely An infinite progress bar loops 0% -> 100% repeatedly until Stop() is called
func NewProgressBarInfinite ¶
func NewProgressBarInfinite() *ProgressBarInfinite
NewProgressBarInfinite creates a new progress bar widget that loops indefinitely from 0% -> 100% SetValue() is not defined for infinite progress bar To stop the looping progress and set the progress bar to 100%, call ProgressBarInfinite.Stop()
func (*ProgressBarInfinite) CreateRenderer ¶
func (p *ProgressBarInfinite) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*ProgressBarInfinite) Hide ¶
func (p *ProgressBarInfinite) Hide()
Hide this widget, if it was previously visible
func (*ProgressBarInfinite) MinSize ¶
func (p *ProgressBarInfinite) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*ProgressBarInfinite) Running ¶
func (p *ProgressBarInfinite) Running() bool
Running returns the current state of the infinite progress animation
func (*ProgressBarInfinite) Show ¶
func (p *ProgressBarInfinite) Show()
Show this widget, if it was previously hidden
func (*ProgressBarInfinite) Start ¶
func (p *ProgressBarInfinite) Start()
Start the infinite progress bar background thread to update it continuously
func (*ProgressBarInfinite) Stop ¶
func (p *ProgressBarInfinite) Stop()
Stop the infinite progress goroutine and sets value to the Max
type Radio ¶
type Radio struct { DisableableWidget Options []string Selected string OnChanged func(string) `json:"-"` Horizontal bool // contains filtered or unexported fields }
Radio widget has a list of text labels and radio check icons next to each. Changing the selection (only one can be selected) will trigger the changed func.
func NewRadio ¶
NewRadio creates a new radio widget with the set options and change handler
func (*Radio) Append ¶
Append adds a new option to the end of a Radio widget.
func (*Radio) CreateRenderer ¶
func (r *Radio) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Radio) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Radio) MouseIn ¶
func (r *Radio) MouseIn(event *desktop.MouseEvent)
MouseIn is called when a desktop pointer enters the widget
func (*Radio) MouseMoved ¶
func (r *Radio) MouseMoved(event *desktop.MouseEvent)
MouseMoved is called when a desktop pointer hovers over the widget
func (*Radio) MouseOut ¶
func (r *Radio) MouseOut()
MouseOut is called when a desktop pointer exits the widget
func (*Radio) SetSelected ¶
SetSelected sets the radio option, it can be used to set a default option.
func (*Radio) Tapped ¶
func (r *Radio) Tapped(event *fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any change handler
func (*Radio) TappedSecondary ¶
func (r *Radio) TappedSecondary(*fyne.PointEvent)
TappedSecondary is called when a secondary pointer tapped event is captured
type ScrollContainer ¶
type ScrollContainer struct { BaseWidget Content fyne.CanvasObject Offset fyne.Position }
ScrollContainer defines a container that is smaller than the Content. The Offset is used to determine the position of the child widgets within the container.
func NewScrollContainer ¶
func NewScrollContainer(content fyne.CanvasObject) *ScrollContainer
NewScrollContainer creates a scrollable parent wrapping the specified content. Note that this may cause the MinSize to be smaller than that of the passed objects.
func (*ScrollContainer) CreateRenderer ¶
func (s *ScrollContainer) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*ScrollContainer) DragEnd ¶
func (s *ScrollContainer) DragEnd()
DragEnd will stop scrolling on mobile has stopped
func (*ScrollContainer) Dragged ¶
func (s *ScrollContainer) Dragged(e *fyne.DragEvent)
Dragged will scroll on any drag - bar or otherwise - for mobile
func (*ScrollContainer) MinSize ¶
func (s *ScrollContainer) MinSize() fyne.Size
MinSize returns the smallest size this widget can shrink to
func (*ScrollContainer) Refresh ¶
func (s *ScrollContainer) Refresh()
Refresh causes this widget to be redrawn in it's current state
func (*ScrollContainer) Resize ¶
func (s *ScrollContainer) Resize(size fyne.Size)
Resize sets a new size for the scroll container.
func (*ScrollContainer) Scrolled ¶
func (s *ScrollContainer) Scrolled(ev *fyne.ScrollEvent)
Scrolled is called when an input device triggers a scroll event
type Select ¶
type Select struct { BaseWidget Selected string Options []string PlaceHolder string OnChanged func(string) `json:"-"` // contains filtered or unexported fields }
Select widget has a list of options, with the current one shown, and triggers an event func when clicked
func NewSelect ¶
NewSelect creates a new select widget with the set list of options and changes handler
func (*Select) CreateRenderer ¶
func (s *Select) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Select) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Select) MouseIn ¶
func (s *Select) MouseIn(*desktop.MouseEvent)
MouseIn is called when a desktop pointer enters the widget
func (*Select) MouseMoved ¶
func (s *Select) MouseMoved(*desktop.MouseEvent)
MouseMoved is called when a desktop pointer hovers over the widget
func (*Select) MouseOut ¶
func (s *Select) MouseOut()
MouseOut is called when a desktop pointer exits the widget
func (*Select) Resize ¶
Resize sets a new size for a widget. Note this should not be used if the widget is being managed by a Layout within a Container.
func (*Select) SetSelected ¶
SetSelected sets the current option of the select widget
func (*Select) Tapped ¶
func (s *Select) Tapped(*fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any tap handler
func (*Select) TappedSecondary ¶
func (s *Select) TappedSecondary(*fyne.PointEvent)
TappedSecondary is called when a secondary pointer tapped event is captured
type Slider ¶
type Slider struct { BaseWidget Value float64 Min float64 Max float64 Step float64 Orientation Orientation OnChanged func(float64) }
Slider if a widget that can slide between two fixed values.
func NewSlider ¶
NewSlider returns a basic slider.
func (*Slider) CreateRenderer ¶
func (s *Slider) CreateRenderer() fyne.WidgetRenderer
CreateRenderer links this widget to its renderer.
func (*Slider) DragEnd ¶
func (s *Slider) DragEnd()
DragEnd function.
func (*Slider) Dragged ¶
Dragged function.
func (*Slider) MinSize ¶
MinSize returns the size that this widget should not shrink below
type TabContainer ¶
type TabContainer struct { BaseWidget Items []*TabItem // contains filtered or unexported fields }
TabContainer widget allows switching visible content from a list of TabItems. Each item is represented by a button at the top of the widget.
func NewTabContainer ¶
func NewTabContainer(items ...*TabItem) *TabContainer
NewTabContainer creates a new tab bar widget that allows the user to choose between different visible containers
func (*TabContainer) Append ¶
func (t *TabContainer) Append(item *TabItem)
Append adds a new TabItem to the rightmost side of the tab panel
func (*TabContainer) CreateRenderer ¶
func (t *TabContainer) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*TabContainer) CurrentTab ¶
func (t *TabContainer) CurrentTab() *TabItem
CurrentTab returns the currently selected TabItem.
func (*TabContainer) CurrentTabIndex ¶
func (t *TabContainer) CurrentTabIndex() int
CurrentTabIndex returns the index of the currently selected TabItem.
func (*TabContainer) MinSize ¶
func (t *TabContainer) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*TabContainer) Remove ¶
func (t *TabContainer) Remove(item *TabItem)
Remove tab by value
func (*TabContainer) RemoveIndex ¶
func (t *TabContainer) RemoveIndex(index int)
RemoveIndex removes tab by index
func (*TabContainer) SelectTab ¶
func (t *TabContainer) SelectTab(item *TabItem)
SelectTab sets the specified TabItem to be selected and its content visible.
func (*TabContainer) SelectTabIndex ¶
func (t *TabContainer) SelectTabIndex(index int)
SelectTabIndex sets the TabItem at the specific index to be selected and its content visible.
func (*TabContainer) SetTabLocation ¶
func (t *TabContainer) SetTabLocation(l TabLocation)
SetTabLocation sets the location of the tab bar
func (*TabContainer) Show ¶
func (t *TabContainer) Show()
Show this widget, if it was previously hidden
type TabItem ¶
type TabItem struct { Text string Icon fyne.Resource Content fyne.CanvasObject }
TabItem represents a single view in a TabContainer. The Text and Icon are used for the tab button and the Content is shown when the corresponding tab is active.
func NewTabItem ¶
func NewTabItem(text string, content fyne.CanvasObject) *TabItem
NewTabItem creates a new item for a tabbed widget - each item specifies the content and a label for its tab.
func NewTabItemWithIcon ¶
NewTabItemWithIcon creates a new item for a tabbed widget - each item specifies the content and a label with an icon for its tab.
type TabLocation ¶
type TabLocation int
TabLocation is the location where the tabs of a tab container should be rendered
const ( TabLocationTop TabLocation = iota TabLocationLeading TabLocationBottom TabLocationTrailing )
TabLocation values
type Toolbar ¶
type Toolbar struct { BaseWidget Items []ToolbarItem // contains filtered or unexported fields }
Toolbar widget creates a horizontal list of tool buttons
func NewToolbar ¶
func NewToolbar(items ...ToolbarItem) *Toolbar
NewToolbar creates a new toolbar widget.
func (*Toolbar) Append ¶
func (t *Toolbar) Append(item ToolbarItem)
Append a new ToolbarItem to the end of this Toolbar
func (*Toolbar) CreateRenderer ¶
func (t *Toolbar) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Toolbar) MinSize ¶
MinSize returns the size that this widget should not shrink below
func (*Toolbar) Prepend ¶
func (t *Toolbar) Prepend(item ToolbarItem)
Prepend a new ToolbarItem to the start of this Toolbar
type ToolbarAction ¶
ToolbarAction is push button style of ToolbarItem
func (*ToolbarAction) ToolbarObject ¶
func (t *ToolbarAction) ToolbarObject() fyne.CanvasObject
ToolbarObject gets a button to render this ToolbarAction
type ToolbarItem ¶
type ToolbarItem interface { ToolbarObject() fyne.CanvasObject }
ToolbarItem represents any interface element that can be added to a toolbar
func NewToolbarAction ¶
func NewToolbarAction(icon fyne.Resource, onActivated func()) ToolbarItem
NewToolbarAction returns a new push button style ToolbarItem
func NewToolbarSeparator ¶
func NewToolbarSeparator() ToolbarItem
NewToolbarSeparator returns a new separator item for a Toolbar to assist with ToolbarItem grouping
func NewToolbarSpacer ¶
func NewToolbarSpacer() ToolbarItem
NewToolbarSpacer returns a new spacer item for a Toolbar to assist with ToolbarItem alignment
type ToolbarSeparator ¶
type ToolbarSeparator struct { }
ToolbarSeparator is a thin, visible divide that can be added to a Toolbar. This is typically used to assist visual grouping of ToolbarItems.
func (*ToolbarSeparator) ToolbarObject ¶
func (t *ToolbarSeparator) ToolbarObject() fyne.CanvasObject
ToolbarObject gets the visible line object for this ToolbarSeparator
type ToolbarSpacer ¶
type ToolbarSpacer struct { }
ToolbarSpacer is a blank, stretchable space for a toolbar. This is typically used to assist layout if you wish some left and some right aligned items. Space will be split evebly amongst all the spacers on a toolbar.
func (*ToolbarSpacer) ToolbarObject ¶
func (t *ToolbarSpacer) ToolbarObject() fyne.CanvasObject
ToolbarObject gets the actual spacer object for this ToolbarSpacer
Source Files ¶
box.go button.go check.go entry.go form.go group.go hyperlink.go icon.go label.go menu.go popup.go progressbar.go progressbarinfinite.go radio.go scroller.go select.go shadow.go slider.go tabcontainer.go text.go toolbar.go widget.go
- Version
- v1.2.1
- Published
- Dec 24, 2019
- Platform
- linux/amd64
- Imports
- 16 packages
- Last checked
- 4 seconds ago –
Tools for package owners.