Documentation ¶
Overview ¶
Package widget defines the UI widgets within the Fyne toolkit.
Index ¶
- Variables
- func NewSimpleRenderer(object fyne.CanvasObject) fyne.WidgetRenderer
- func ShowModalPopUp(content fyne.CanvasObject, canvas fyne.Canvas)
- func ShowPopUp(content fyne.CanvasObject, canvas fyne.Canvas)
- func ShowPopUpAtPosition(content fyne.CanvasObject, canvas fyne.Canvas, pos fyne.Position)
- func ShowPopUpMenuAtPosition(menu *fyne.Menu, c fyne.Canvas, pos fyne.Position)
- type Accordion
- func (a *Accordion) Append(item *AccordionItem)
- func (a *Accordion) Close(index int)
- func (a *Accordion) CloseAll()
- func (a *Accordion) CreateRenderer() fyne.WidgetRenderer
- func (a *Accordion) MinSize() fyne.Size
- func (a *Accordion) Open(index int)
- func (a *Accordion) OpenAll()
- func (a *Accordion) Remove(item *AccordionItem)
- func (a *Accordion) RemoveIndex(index int)
- type AccordionItem
- type BaseWidget
- 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 Button
- func (b *Button) CreateRenderer() fyne.WidgetRenderer
- func (b *Button) Cursor() desktop.Cursor
- func (b *Button) FocusGained()
- func (b *Button) FocusLost()
- 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) TypedKey(ev *fyne.KeyEvent)
- func (b *Button) TypedRune(rune)
- type ButtonAlign
- type ButtonIconPlacement
- type ButtonImportance
- type ButtonStyle
- type Card
- type Check
- func (c *Check) Bind(data binding.Bool)
- func (c *Check) CreateRenderer() fyne.WidgetRenderer
- func (c *Check) FocusGained()
- func (c *Check) FocusLost()
- 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) TypedKey(key *fyne.KeyEvent)
- func (c *Check) TypedRune(r rune)
- func (c *Check) Unbind()
- type CheckGroup
- type CustomTextGridStyle
- type DisableableWidget
- type Entry
- func (e *Entry) AcceptsTab() bool
- func (e *Entry) Bind(data binding.String)
- func (e *Entry) CreateRenderer() fyne.WidgetRenderer
- func (e *Entry) Cursor() desktop.Cursor
- func (e *Entry) Disable()
- func (e *Entry) Disabled() bool
- func (e *Entry) DoubleTapped(p *fyne.PointEvent)
- func (e *Entry) DragEnd()
- func (e *Entry) Dragged(d *fyne.DragEvent)
- func (e *Entry) Enable()
- func (e *Entry) ExtendBaseWidget(wid fyne.Widget)
- func (e *Entry) FocusGained()
- func (e *Entry) FocusLost()
- func (e *Entry) Hide()
- func (e *Entry) KeyDown(key *fyne.KeyEvent)
- func (e *Entry) KeyUp(key *fyne.KeyEvent)
- func (e *Entry) Keyboard() mobile.KeyboardType
- func (e *Entry) MinSize() fyne.Size
- func (e *Entry) MouseDown(m *desktop.MouseEvent)
- func (e *Entry) MouseUp(m *desktop.MouseEvent)
- func (e *Entry) SelectedText() string
- func (e *Entry) SetMinRowsVisible(count int)
- func (e *Entry) SetOnValidationChanged(callback func(error))
- func (e *Entry) SetPlaceHolder(text string)
- func (e *Entry) SetText(text string)
- func (e *Entry) SetValidationError(err error)
- func (e *Entry) Tapped(ev *fyne.PointEvent)
- func (e *Entry) TappedSecondary(pe *fyne.PointEvent)
- func (e *Entry) TouchCancel(*mobile.TouchEvent)
- func (e *Entry) TouchDown(ev *mobile.TouchEvent)
- func (e *Entry) TouchUp(*mobile.TouchEvent)
- func (e *Entry) TypedKey(key *fyne.KeyEvent)
- func (e *Entry) TypedRune(r rune)
- func (e *Entry) TypedShortcut(shortcut fyne.Shortcut)
- func (e *Entry) Unbind()
- func (e *Entry) Validate() error
- type FileIcon
- type 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) Disable()
- func (f *Form) Disabled() bool
- func (f *Form) Enable()
- func (f *Form) MinSize() fyne.Size
- func (f *Form) Refresh()
- func (f *Form) SetOnValidationChanged(callback func(error))
- func (f *Form) Validate() error
- type FormItem
- type Hyperlink
- func (hl *Hyperlink) CreateRenderer() fyne.WidgetRenderer
- func (hl *Hyperlink) Cursor() desktop.Cursor
- func (hl *Hyperlink) FocusGained()
- func (hl *Hyperlink) FocusLost()
- func (hl *Hyperlink) MinSize() fyne.Size
- func (hl *Hyperlink) MouseIn(*desktop.MouseEvent)
- func (hl *Hyperlink) MouseMoved(*desktop.MouseEvent)
- func (hl *Hyperlink) MouseOut()
- func (hl *Hyperlink) Refresh()
- func (hl *Hyperlink) Resize(size fyne.Size)
- func (hl *Hyperlink) SetText(text string)
- func (hl *Hyperlink) SetURL(url *url.URL)
- func (hl *Hyperlink) SetURLFromString(str string) error
- func (hl *Hyperlink) Tapped(*fyne.PointEvent)
- func (hl *Hyperlink) TypedKey(ev *fyne.KeyEvent)
- func (hl *Hyperlink) TypedRune(rune)
- type HyperlinkSegment
- func (h *HyperlinkSegment) Inline() bool
- func (h *HyperlinkSegment) Select(begin, end fyne.Position)
- func (h *HyperlinkSegment) SelectedText() string
- func (h *HyperlinkSegment) Textual() string
- func (h *HyperlinkSegment) Unselect()
- func (h *HyperlinkSegment) Update(o fyne.CanvasObject)
- func (h *HyperlinkSegment) Visual() fyne.CanvasObject
- type Icon
- type ImageSegment
- func (i *ImageSegment) Inline() bool
- func (i *ImageSegment) Select(begin, end fyne.Position)
- func (i *ImageSegment) SelectedText() string
- func (i *ImageSegment) Textual() string
- func (i *ImageSegment) Unselect()
- func (i *ImageSegment) Update(o fyne.CanvasObject)
- func (i *ImageSegment) Visual() fyne.CanvasObject
- type Label
- func (l *Label) Bind(data binding.String)
- func (l *Label) CreateRenderer() fyne.WidgetRenderer
- func (l *Label) ExtendBaseWidget(w fyne.Widget)
- func (l *Label) MinSize() fyne.Size
- func (l *Label) Refresh()
- func (l *Label) Resize(s fyne.Size)
- func (l *Label) SetText(text string)
- func (l *Label) Unbind()
- type List
- func (l *List) CreateRenderer() fyne.WidgetRenderer
- func (l *List) MinSize() fyne.Size
- func (l *List) Resize(s fyne.Size)
- func (l *List) ScrollTo(id ListItemID)
- func (l *List) ScrollToBottom()
- func (l *List) ScrollToTop()
- func (l *List) Select(id ListItemID)
- func (l *List) SetItemHeight(id ListItemID, height float32)
- func (l *List) Unselect(id ListItemID)
- func (l *List) UnselectAll()
- type ListItemID
- type ListSegment
- func (l *ListSegment) Inline() bool
- func (l *ListSegment) Segments() []RichTextSegment
- func (l *ListSegment) Select(_, _ fyne.Position)
- func (l *ListSegment) SelectedText() string
- func (l *ListSegment) Textual() string
- func (l *ListSegment) Unselect()
- func (l *ListSegment) Update(fyne.CanvasObject)
- func (l *ListSegment) Visual() fyne.CanvasObject
- type Menu
- func (m *Menu) ActivateLastSubmenu() bool
- func (m *Menu) ActivateNext()
- func (m *Menu) ActivatePrevious()
- func (m *Menu) CreateRenderer() fyne.WidgetRenderer
- func (m *Menu) DeactivateChild()
- func (m *Menu) DeactivateLastSubmenu() bool
- func (m *Menu) Dismiss()
- func (m *Menu) MinSize() fyne.Size
- func (m *Menu) Refresh()
- func (m *Menu) Tapped(*fyne.PointEvent)
- func (m *Menu) TriggerLast()
- type Orientation
- type ParagraphSegment
- func (p *ParagraphSegment) Inline() bool
- func (p *ParagraphSegment) Segments() []RichTextSegment
- func (p *ParagraphSegment) Select(_, _ fyne.Position)
- func (p *ParagraphSegment) SelectedText() string
- func (p *ParagraphSegment) Textual() string
- func (p *ParagraphSegment) Unselect()
- func (p *ParagraphSegment) Update(fyne.CanvasObject)
- func (p *ParagraphSegment) Visual() fyne.CanvasObject
- type 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) ShowAtPosition(pos fyne.Position)
- func (p *PopUp) Tapped(_ *fyne.PointEvent)
- func (p *PopUp) TappedSecondary(_ *fyne.PointEvent)
- type PopUpMenu
- func (p *PopUpMenu) FocusGained()
- func (p *PopUpMenu) FocusLost()
- func (p *PopUpMenu) Hide()
- func (p *PopUpMenu) Move(pos fyne.Position)
- func (p *PopUpMenu) Resize(size fyne.Size)
- func (p *PopUpMenu) Show()
- func (p *PopUpMenu) ShowAtPosition(pos fyne.Position)
- func (p *PopUpMenu) TypedKey(e *fyne.KeyEvent)
- func (p *PopUpMenu) TypedRune(rune)
- type ProgressBar
- type 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 RadioGroup
- type RichText
- type RichTextBlock
- type RichTextSegment
- type RichTextStyle
- type Select
- func (s *Select) ClearSelected()
- func (s *Select) CreateRenderer() fyne.WidgetRenderer
- func (s *Select) FocusGained()
- func (s *Select) FocusLost()
- func (s *Select) Hide()
- 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) Move(pos fyne.Position)
- func (s *Select) Resize(size fyne.Size)
- func (s *Select) SelectedIndex() int
- func (s *Select) SetSelected(text string)
- func (s *Select) SetSelectedIndex(index int)
- func (s *Select) Tapped(*fyne.PointEvent)
- func (s *Select) TypedKey(event *fyne.KeyEvent)
- func (s *Select) TypedRune(_ rune)
- type SelectEntry
- func (e *SelectEntry) CreateRenderer() fyne.WidgetRenderer
- func (e *SelectEntry) Disable()
- func (e *SelectEntry) Enable()
- func (e *SelectEntry) MinSize() fyne.Size
- func (e *SelectEntry) Move(pos fyne.Position)
- func (e *SelectEntry) Resize(size fyne.Size)
- func (e *SelectEntry) SetOptions(options []string)
- type Separator
- type SeparatorSegment
- func (s *SeparatorSegment) Inline() bool
- func (s *SeparatorSegment) Select(_, _ fyne.Position)
- func (s *SeparatorSegment) SelectedText() string
- func (s *SeparatorSegment) Textual() string
- func (s *SeparatorSegment) Unselect()
- func (s *SeparatorSegment) Update(fyne.CanvasObject)
- func (s *SeparatorSegment) Visual() fyne.CanvasObject
- type Slider
- type Table
- func (t *Table) CreateRenderer() fyne.WidgetRenderer
- func (t *Table) ScrollTo(id TableCellID)
- func (t *Table) ScrollToBottom()
- func (t *Table) ScrollToLeading()
- func (t *Table) ScrollToTop()
- func (t *Table) ScrollToTrailing()
- func (t *Table) Select(id TableCellID)
- func (t *Table) SetColumnWidth(id int, width float32)
- func (t *Table) SetRowHeight(id int, height float32)
- func (t *Table) Unselect(id TableCellID)
- func (t *Table) UnselectAll()
- type TableCellID
- type TextGrid
- func (t *TextGrid) CreateRenderer() fyne.WidgetRenderer
- func (t *TextGrid) MinSize() fyne.Size
- func (t *TextGrid) Resize(size fyne.Size)
- func (t *TextGrid) Row(row int) TextGridRow
- func (t *TextGrid) RowText(row int) string
- func (t *TextGrid) SetCell(row, col int, cell TextGridCell)
- func (t *TextGrid) SetRow(row int, content TextGridRow)
- func (t *TextGrid) SetRowStyle(row int, style TextGridStyle)
- func (t *TextGrid) SetRune(row, col int, r rune)
- func (t *TextGrid) SetStyle(row, col int, style TextGridStyle)
- func (t *TextGrid) SetStyleRange(startRow, startCol, endRow, endCol int, style TextGridStyle)
- func (t *TextGrid) SetText(text string)
- func (t *TextGrid) Text() string
- type TextGridCell
- type TextGridRow
- type TextGridStyle
- type TextSegment
- func (t *TextSegment) Inline() bool
- func (t *TextSegment) Select(begin, end fyne.Position)
- func (t *TextSegment) SelectedText() string
- func (t *TextSegment) Textual() string
- func (t *TextSegment) Unselect()
- func (t *TextSegment) Update(o fyne.CanvasObject)
- func (t *TextSegment) Visual() fyne.CanvasObject
- type Toolbar
- type ToolbarAction
- type ToolbarItem
- type ToolbarSeparator
- type ToolbarSpacer
- type Tree
- func (t *Tree) CloseAllBranches()
- func (t *Tree) CloseBranch(uid TreeNodeID)
- func (t *Tree) CreateRenderer() fyne.WidgetRenderer
- func (t *Tree) IsBranchOpen(uid TreeNodeID) bool
- func (t *Tree) MinSize() fyne.Size
- func (t *Tree) OpenAllBranches()
- func (t *Tree) OpenBranch(uid TreeNodeID)
- func (t *Tree) Resize(size fyne.Size)
- func (t *Tree) ScrollTo(uid TreeNodeID)
- func (t *Tree) ScrollToBottom()
- func (t *Tree) ScrollToTop()
- func (t *Tree) Select(uid TreeNodeID)
- func (t *Tree) ToggleBranch(uid string)
- func (t *Tree) Unselect(uid TreeNodeID)
- func (t *Tree) UnselectAll()
- type TreeNodeID
Constants ¶
This section is empty.
Variables ¶
var ( // RichTextStyleBlockquote represents a quote presented in an indented block. // // Since: 2.1 RichTextStyleBlockquote = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: false, SizeName: theme.SizeNameText, TextStyle: fyne.TextStyle{Italic: true}, } // RichTextStyleCodeBlock represents a code blog segment. // // Since: 2.1 RichTextStyleCodeBlock = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: false, SizeName: theme.SizeNameText, TextStyle: fyne.TextStyle{Monospace: true}, } // RichTextStyleCodeInline represents an inline code segment. // // Since: 2.1 RichTextStyleCodeInline = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: true, SizeName: theme.SizeNameText, TextStyle: fyne.TextStyle{Monospace: true}, } // RichTextStyleEmphasis represents regular text with emphasis. // // Since: 2.1 RichTextStyleEmphasis = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: true, SizeName: theme.SizeNameText, TextStyle: fyne.TextStyle{Italic: true}, } // RichTextStyleHeading represents a heading text that stands on its own line. // // Since: 2.1 RichTextStyleHeading = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: false, SizeName: theme.SizeNameHeadingText, TextStyle: fyne.TextStyle{Bold: true}, } // RichTextStyleInline represents standard text that can be surrounded by other elements. // // Since: 2.1 RichTextStyleInline = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: true, SizeName: theme.SizeNameText, } // RichTextStyleParagraph represents standard text that should appear separate from other text. // // Since: 2.1 RichTextStyleParagraph = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: false, SizeName: theme.SizeNameText, } // RichTextStylePassword represents standard sized text where the characters are obscured. // // Since: 2.1 RichTextStylePassword = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: true, SizeName: theme.SizeNameText, // contains filtered or unexported fields } // RichTextStyleStrong represents regular text with a strong emphasis. // // Since: 2.1 RichTextStyleStrong = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: true, SizeName: theme.SizeNameText, TextStyle: fyne.TextStyle{Bold: true}, } // RichTextStyleSubHeading represents a sub-heading text that stands on its own line. // // Since: 2.1 RichTextStyleSubHeading = RichTextStyle{ ColorName: theme.ColorNameForeground, Inline: false, SizeName: theme.SizeNameSubHeadingText, TextStyle: fyne.TextStyle{Bold: true}, } )
Functions ¶
func NewSimpleRenderer ¶
func NewSimpleRenderer(object fyne.CanvasObject) fyne.WidgetRenderer
NewSimpleRenderer creates a new SimpleRenderer to render a widget using a single fyne.CanvasObject.
Since: 2.1
func ShowModalPopUp ¶
func ShowModalPopUp(content fyne.CanvasObject, canvas fyne.Canvas)
ShowModalPopUp 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 ShowPopUp ¶
func ShowPopUp(content fyne.CanvasObject, canvas fyne.Canvas)
ShowPopUp creates a new popUp for the specified content and displays it on the passed canvas.
func ShowPopUpAtPosition ¶
func ShowPopUpAtPosition(content fyne.CanvasObject, canvas fyne.Canvas, pos fyne.Position)
ShowPopUpAtPosition creates a new popUp for the specified content at the specified absolute position. It will then display the popup on the passed canvas.
func ShowPopUpMenuAtPosition ¶
func ShowPopUpMenuAtPosition(menu *fyne.Menu, c fyne.Canvas, pos fyne.Position)
ShowPopUpMenuAtPosition creates a PopUp menu populated with items from the passed menu structure. It will automatically be positioned at the provided location and shown as an overlay on the specified canvas.
Types ¶
type Accordion ¶
type Accordion struct { BaseWidget Items []*AccordionItem MultiOpen bool }
Accordion displays a list of AccordionItems. Each item is represented by a button that reveals a detailed view when tapped.
func NewAccordion ¶
func NewAccordion(items ...*AccordionItem) *Accordion
NewAccordion creates a new accordion widget.
func (*Accordion) Append ¶
func (a *Accordion) Append(item *AccordionItem)
Append adds the given item to this Accordion.
func (*Accordion) CreateRenderer ¶
func (a *Accordion) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Accordion) MinSize ¶
func (a *Accordion) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below.
func (*Accordion) Remove ¶
func (a *Accordion) Remove(item *AccordionItem)
Remove deletes the given item from this Accordion.
func (*Accordion) RemoveIndex ¶
RemoveIndex deletes the item at the given index from this Accordion.
type AccordionItem ¶
AccordionItem represents a single item in an Acc rdion.
func NewAccordionItem ¶
func NewAccordionItem(title string, detail fyne.CanvasObject) *AccordionItem
NewAccordionItem creates a new item for an Accordion.
type BaseWidget ¶
type BaseWidget struct { Hidden bool // contains filtered or unexported fields }
BaseWidget provides a helper that handles basic widget behaviours.
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) 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) 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 Button ¶
type Button struct { DisableableWidget Text string Icon fyne.Resource // Specify how prominent the button should be, High will highlight the button and Low will remove some decoration. // // Since: 1.4 Importance ButtonImportance Alignment ButtonAlign IconPlacement ButtonIconPlacement OnTapped func() `json:"-"` // contains filtered or unexported fields }
Button widget has a text label and triggers an event func when clicked
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) FocusGained ¶
func (b *Button) FocusGained()
FocusGained is a hook called by the focus handling logic after this object gained the focus.
func (*Button) FocusLost ¶
func (b *Button) FocusLost()
FocusLost is a hook called by the focus handling logic after this object lost the focus.
func (*Button) MinSize ¶
func (b *Button) MinSize() fyne.Size
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 ¶
func (b *Button) SetIcon(icon fyne.Resource)
SetIcon updates the icon on a label - pass nil to hide an icon
func (*Button) Tapped ¶
func (b *Button) Tapped(*fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any tap handler
type ButtonAlign ¶
type ButtonAlign int
ButtonAlign represents the horizontal alignment of a button.
const ( // ButtonAlignCenter aligns the icon and the text centrally. ButtonAlignCenter ButtonAlign = iota // ButtonAlignLeading aligns the icon and the text with the leading edge. ButtonAlignLeading // ButtonAlignTrailing aligns the icon and the text with the trailing edge. ButtonAlignTrailing )
type ButtonIconPlacement ¶
type ButtonIconPlacement int
ButtonIconPlacement represents the ordering of icon & text within a button.
const ( // ButtonIconLeadingText aligns the icon on the leading edge of the text. ButtonIconLeadingText ButtonIconPlacement = iota // ButtonIconTrailingText aligns the icon on the trailing edge of the text. ButtonIconTrailingText )
type ButtonImportance ¶
type ButtonImportance int
ButtonImportance represents how prominent the button should appear
Since: 1.4
const ( // MediumImportance applies a standard appearance. MediumImportance ButtonImportance = iota // HighImportance applies a prominent appearance. HighImportance // LowImportance applies a subtle appearance. LowImportance // DangerImportance applies an error theme to the button. // // Since 2.3 DangerImportance // WarningImportance applies an error theme to the button. // // Since 2.3 WarningImportance )
type ButtonStyle ¶
type ButtonStyle int
ButtonStyle determines the behaviour and rendering of a button.
type Card ¶
type Card struct { BaseWidget Title, Subtitle string Image *canvas.Image Content fyne.CanvasObject }
Card widget groups title, subtitle with content and a header image
Since: 1.4
func NewCard ¶
NewCard creates a new card widget with the specified title, subtitle and content (all optional).
Since: 1.4
func (*Card) CreateRenderer ¶
func (c *Card) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Card) MinSize ¶
func (c *Card) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*Card) SetContent ¶
func (c *Card) SetContent(obj fyne.CanvasObject)
SetContent changes the body of this card to have the specified content.
func (*Card) SetSubTitle ¶
SetSubTitle updates the secondary title for this card.
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 NewCheckWithData ¶
NewCheckWithData returns a check widget connected with the specified data source.
Since: 2.0
func (*Check) Bind ¶
Bind connects the specified data source to this Check. The current value will be displayed and any changes in the data will cause the widget to update. User interactions with this Check will set the value into the data source.
Since: 2.0
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) MinSize ¶
func (c *Check) MinSize() fyne.Size
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) TypedKey ¶
func (c *Check) TypedKey(key *fyne.KeyEvent)
TypedKey receives key input events when the Check is focused.
type CheckGroup ¶
type CheckGroup struct { DisableableWidget Horizontal bool Required bool OnChanged func([]string) `json:"-"` Options []string Selected []string // contains filtered or unexported fields }
CheckGroup widget has a list of text labels and checkbox icons next to each. Changing the selection (any number can be selected) will trigger the changed func.
Since: 2.1
func NewCheckGroup ¶
func NewCheckGroup(options []string, changed func([]string)) *CheckGroup
NewCheckGroup creates a new check group widget with the set options and change handler
Since: 2.1
func (*CheckGroup) Append ¶
func (r *CheckGroup) Append(option string)
Append adds a new option to the end of a CheckGroup widget.
func (*CheckGroup) CreateRenderer ¶
func (r *CheckGroup) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*CheckGroup) MinSize ¶
func (r *CheckGroup) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*CheckGroup) Refresh ¶
func (r *CheckGroup) Refresh()
Refresh causes this widget to be redrawn in it's current state.
Implements: fyne.CanvasObject
func (*CheckGroup) Remove ¶
func (r *CheckGroup) Remove(option string) bool
Remove removes the first occurrence of the specified option found from a CheckGroup widget. Return true if an option was removed.
Since: 2.3
func (*CheckGroup) SetSelected ¶
func (r *CheckGroup) SetSelected(options []string)
SetSelected sets the checked options, it can be used to set a default option.
type CustomTextGridStyle ¶
CustomTextGridStyle is a utility type for those not wanting to define their own style types.
func (*CustomTextGridStyle) BackgroundColor ¶
func (c *CustomTextGridStyle) BackgroundColor() color.Color
BackgroundColor is the color a cell should use for the background.
func (*CustomTextGridStyle) TextColor ¶
func (c *CustomTextGridStyle) TextColor() color.Color
TextColor is the color a cell should use for the text.
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 Text string // Since: 2.0 TextStyle fyne.TextStyle PlaceHolder string OnChanged func(string) `json:"-"` // Since: 2.0 OnSubmitted func(string) `json:"-"` Password bool MultiLine bool Wrapping fyne.TextWrap // Set a validator that this entry will check against // Since: 1.4 Validator fyne.StringValidator `json:"-"` CursorRow, CursorColumn int OnCursorChanged func() `json:"-"` // ActionItem is a small item which is displayed at the outer right of the entry (like a password revealer) ActionItem fyne.CanvasObject `json:"-"` // contains filtered or unexported fields }
Entry widget allows simple text to be input when focused.
func NewEntryWithData ¶
NewEntryWithData returns an Entry widget connected to the specified data source.
Since: 2.0
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) AcceptsTab ¶
AcceptsTab returns if Entry accepts the Tab key or not.
Implements: fyne.Tabbable
Since: 2.1
func (*Entry) Bind ¶
Bind connects the specified data source to this Entry. The current value will be displayed and any changes in the data will cause the widget to update. User interactions with this Entry will set the value into the data source.
Since: 2.0
func (*Entry) CreateRenderer ¶
func (e *Entry) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
Implements: fyne.Widget
func (*Entry) Disable ¶
func (e *Entry) Disable()
Disable this widget so that it cannot be interacted with, updating any style appropriately.
Implements: fyne.Disableable
func (*Entry) Disabled ¶
Disabled returns whether the entry is disabled or read-only.
Implements: fyne.Disableable
func (*Entry) DoubleTapped ¶
func (e *Entry) DoubleTapped(p *fyne.PointEvent)
DoubleTapped is called when this entry has been double tapped so we should select text below the pointer
Implements: fyne.DoubleTappable
func (*Entry) DragEnd ¶
func (e *Entry) DragEnd()
DragEnd is called at end of a drag event.
Implements: fyne.Draggable
func (*Entry) Dragged ¶
func (e *Entry) Dragged(d *fyne.DragEvent)
Dragged is called when the pointer moves while a button is held down. It updates the selection accordingly.
Implements: fyne.Draggable
func (*Entry) Enable ¶
func (e *Entry) Enable()
Enable this widget, updating any style or features appropriately.
Implements: fyne.Disableable
func (*Entry) ExtendBaseWidget ¶
func (e *Entry) ExtendBaseWidget(wid fyne.Widget)
ExtendBaseWidget is used by an extending widget to make use of BaseWidget functionality.
func (*Entry) FocusGained ¶
func (e *Entry) FocusGained()
FocusGained is called when the Entry has been given focus.
Implements: fyne.Focusable
func (*Entry) FocusLost ¶
func (e *Entry) FocusLost()
FocusLost is called when the Entry has had focus removed.
Implements: fyne.Focusable
func (*Entry) KeyDown ¶
func (e *Entry) KeyDown(key *fyne.KeyEvent)
KeyDown handler for keypress events - used to store shift modifier state for text selection
Implements: desktop.Keyable
func (*Entry) KeyUp ¶
func (e *Entry) KeyUp(key *fyne.KeyEvent)
KeyUp handler for key release events - used to reset shift modifier state for text selection
Implements: desktop.Keyable
func (*Entry) Keyboard ¶
func (e *Entry) Keyboard() mobile.KeyboardType
Keyboard implements the Keyboardable interface
Implements: mobile.Keyboardable
func (*Entry) MinSize ¶
func (e *Entry) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below.
Implements: fyne.Widget
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.
Implements: desktop.Mouseable
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
Implements: desktop.Mouseable
func (*Entry) SelectedText ¶
SelectedText returns the text currently selected in this Entry. If there is no selection it will return the empty string.
func (*Entry) SetMinRowsVisible ¶
SetMinRowsVisible forces a multi-line entry to show `count` number of rows without scrolling. This is not a validation or requirement, it just impacts the minimum visible size. Use this carefully as Fyne apps can run on small screens so you may wish to add a scroll container if this number is high. Default is 3.
Since: 2.2
func (*Entry) SetOnValidationChanged ¶
SetOnValidationChanged is intended for parent widgets or containers to hook into the validation. The function might be overwritten by a parent that cares about child validation (e.g. widget.Form).
func (*Entry) SetPlaceHolder ¶
SetPlaceHolder sets the text that will be displayed if the entry is otherwise empty
func (*Entry) SetValidationError ¶
SetValidationError manually updates the validation status until the next input change
func (*Entry) Tapped ¶
func (e *Entry) Tapped(ev *fyne.PointEvent)
Tapped is called when this entry has been tapped. We update the cursor position in device-specific callbacks (MouseDown() and TouchDown()).
Implements: fyne.Tappable
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.
Implements: fyne.SecondaryTappable
func (*Entry) TouchCancel ¶
func (e *Entry) TouchCancel(*mobile.TouchEvent)
TouchCancel is called when this entry gets a touch cancel event on mobile device (app was removed from focus).
Since: 2.1
Implements: mobile.Touchable
func (*Entry) TouchDown ¶
func (e *Entry) TouchDown(ev *mobile.TouchEvent)
TouchDown is called when this entry gets a touch down event on mobile device, we ensure we have focus.
Since: 2.1
Implements: mobile.Touchable
func (*Entry) TouchUp ¶
func (e *Entry) TouchUp(*mobile.TouchEvent)
TouchUp is called when this entry gets a touch up event on mobile device.
Since: 2.1
Implements: mobile.Touchable
func (*Entry) TypedKey ¶
func (e *Entry) TypedKey(key *fyne.KeyEvent)
TypedKey receives key input events when the Entry widget is focused.
Implements: fyne.Focusable
func (*Entry) TypedRune ¶
TypedRune receives text input events when the Entry widget is focused.
Implements: fyne.Focusable
func (*Entry) TypedShortcut ¶
func (e *Entry) TypedShortcut(shortcut fyne.Shortcut)
TypedShortcut implements the Shortcutable interface
Implements: fyne.Shortcutable
type FileIcon ¶
type FileIcon struct { BaseWidget // Deprecated: Selection is now handled externally. Selected bool URI fyne.URI // contains filtered or unexported fields }
FileIcon is an adaption of widget.Icon for showing files and folders
Since: 1.4
func NewFileIcon ¶
func NewFileIcon(uri fyne.URI) *FileIcon
NewFileIcon takes a filepath and creates an icon with an overlaid label using the detected mimetype and extension
Since: 1.4
func (*FileIcon) CreateRenderer ¶
func (i *FileIcon) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*FileIcon) MinSize ¶
func (i *FileIcon) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*FileIcon) SetSelected
deprecated
type Form ¶
type Form struct { BaseWidget Items []*FormItem OnSubmit func() `json:"-"` OnCancel func() `json:"-"` SubmitText string CancelText string // 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. If you change OnSubmit/OnCancel after the form is created and rendered, you need to call Refresh() to update the form with the correct buttons. Setting OnSubmit/OnCancel to nil will remove the buttons.
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 ¶
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) Disabled ¶
Disabled returns whether submitting the form is disabled. Note that, if the form fails validation, the submit button may be disabled even if this method returns true.
Since: 2.1
func (*Form) MinSize ¶
func (f *Form) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*Form) SetOnValidationChanged ¶
SetOnValidationChanged is intended for parent widgets or containers to hook into the validation. The function might be overwritten by a parent that cares about child validation (e.g. widget.Form)
type FormItem ¶
type FormItem struct { Text string Widget fyne.CanvasObject // Since: 2.0 HintText string // contains filtered or unexported fields }
FormItem provides the details for a row in a form
func NewFormItem ¶
NewFormItem creates a new form item with the specified label text and input widget
type Hyperlink ¶
type Hyperlink struct { BaseWidget Text string URL *url.URL Alignment fyne.TextAlign // The alignment of the Text Wrapping fyne.TextWrap // The wrapping of the Text TextStyle fyne.TextStyle // The style of the hyperlink text // OnTapped overrides the default `fyne.OpenURL` call when the link is tapped // // Since: 2.2 OnTapped func() `json:"-"` // 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) FocusGained ¶
func (hl *Hyperlink) FocusGained()
FocusGained is a hook called by the focus handling logic after this object gained the focus.
func (*Hyperlink) FocusLost ¶
func (hl *Hyperlink) FocusLost()
FocusLost is a hook called by the focus handling logic after this object lost the focus.
func (*Hyperlink) MinSize ¶
func (hl *Hyperlink) MinSize() fyne.Size
MinSize returns the smallest size this widget can shrink to
func (*Hyperlink) MouseIn ¶
func (hl *Hyperlink) MouseIn(*desktop.MouseEvent)
MouseIn is a hook that is called if the mouse pointer enters the element.
func (*Hyperlink) MouseMoved ¶
func (hl *Hyperlink) MouseMoved(*desktop.MouseEvent)
MouseMoved is a hook that is called if the mouse pointer moved over the element.
func (*Hyperlink) MouseOut ¶
func (hl *Hyperlink) MouseOut()
MouseOut is a hook that is called if the mouse pointer leaves the element.
func (*Hyperlink) Refresh ¶
func (hl *Hyperlink) Refresh()
Refresh triggers a redraw of the hyperlink.
Implements: fyne.Widget
func (*Hyperlink) Resize ¶
func (hl *Hyperlink) Resize(size fyne.Size)
Resize sets a new size for the hyperlink. Note this should not be used if the widget is being managed by a Layout within a Container.
func (*Hyperlink) SetURLFromString ¶
SetURLFromString sets the URL of the hyperlink, taking in a string type
func (*Hyperlink) Tapped ¶
func (hl *Hyperlink) Tapped(*fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any change handler
type HyperlinkSegment ¶
HyperlinkSegment represents a hyperlink within a rich text widget.
Since: 2.1
func (*HyperlinkSegment) Inline ¶
func (h *HyperlinkSegment) Inline() bool
Inline returns true as hyperlinks are inside other elements.
func (*HyperlinkSegment) Select ¶
func (h *HyperlinkSegment) Select(begin, end fyne.Position)
Select tells the segment that the user is selecting the content between the two positions.
func (*HyperlinkSegment) SelectedText ¶
func (h *HyperlinkSegment) SelectedText() string
SelectedText should return the text representation of any content currently selected through the Select call.
func (*HyperlinkSegment) Textual ¶
func (h *HyperlinkSegment) Textual() string
Textual returns the content of this segment rendered to plain text.
func (*HyperlinkSegment) Unselect ¶
func (h *HyperlinkSegment) Unselect()
Unselect tells the segment that the user is has cancelled the previous selection.
func (*HyperlinkSegment) Update ¶
func (h *HyperlinkSegment) Update(o fyne.CanvasObject)
Update applies the current state of this hyperlink segment to an existing visual.
func (*HyperlinkSegment) Visual ¶
func (h *HyperlinkSegment) Visual() fyne.CanvasObject
Visual returns the hyperlink widget required to render this segment.
type Icon ¶
type Icon struct { BaseWidget Resource fyne.Resource // The resource for this icon // contains filtered or unexported fields }
Icon widget is a basic image component that load's its resource to match the theme.
func NewIcon ¶
func NewIcon(res fyne.Resource) *Icon
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 ¶
func (i *Icon) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*Icon) SetResource ¶
func (i *Icon) SetResource(res fyne.Resource)
SetResource updates the resource rendered in this icon widget
type ImageSegment ¶
type ImageSegment struct { Source fyne.URI Title string }
ImageSegment represents an image within a rich text widget.
Since: 2.3
func (*ImageSegment) Inline ¶
func (i *ImageSegment) Inline() bool
Inline returns false as images in rich text are blocks.
func (*ImageSegment) Select ¶
func (i *ImageSegment) Select(begin, end fyne.Position)
Select tells the segment that the user is selecting the content between the two positions.
func (*ImageSegment) SelectedText ¶
func (i *ImageSegment) SelectedText() string
SelectedText should return the text representation of any content currently selected through the Select call.
func (*ImageSegment) Textual ¶
func (i *ImageSegment) Textual() string
Textual returns the content of this segment rendered to plain text.
func (*ImageSegment) Unselect ¶
func (i *ImageSegment) Unselect()
Unselect tells the segment that the user is has cancelled the previous selection.
func (*ImageSegment) Update ¶
func (i *ImageSegment) Update(o fyne.CanvasObject)
Update applies the current state of this image segment to an existing visual.
func (*ImageSegment) Visual ¶
func (i *ImageSegment) Visual() fyne.CanvasObject
Visual returns the image widget required to render this segment.
type Label ¶
type Label struct { BaseWidget Text string Alignment fyne.TextAlign // The alignment of the Text Wrapping fyne.TextWrap // The wrapping 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 NewLabelWithData ¶
NewLabelWithData returns an Label widget connected to the specified data source.
Since: 2.0
func NewLabelWithStyle ¶
NewLabelWithStyle creates a new label widget with the set text content
func (*Label) Bind ¶
Bind connects the specified data source to this Label. The current value will be displayed and any changes in the data will cause the widget to update.
Since: 2.0
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) ExtendBaseWidget ¶
func (l *Label) ExtendBaseWidget(w fyne.Widget)
ExtendBaseWidget is used by an extending widget to make use of BaseWidget functionality.
func (*Label) MinSize ¶
func (l *Label) MinSize() fyne.Size
MinSize returns the size that this label should not shrink below.
Implements: fyne.Widget
func (*Label) Refresh ¶
func (l *Label) Refresh()
Refresh triggers a redraw of the label.
Implements: fyne.Widget
type List ¶
type List struct { BaseWidget Length func() int `json:"-"` CreateItem func() fyne.CanvasObject `json:"-"` UpdateItem func(id ListItemID, item fyne.CanvasObject) `json:"-"` OnSelected func(id ListItemID) `json:"-"` OnUnselected func(id ListItemID) `json:"-"` // contains filtered or unexported fields }
List is a widget that pools list items for performance and lays the items out in a vertical direction inside of a scroller. List requires that all items are the same size.
Since: 1.4
func NewList ¶
func NewList(length func() int, createItem func() fyne.CanvasObject, updateItem func(ListItemID, fyne.CanvasObject)) *List
NewList creates and returns a list widget for displaying items in a vertical layout with scrolling and caching for performance.
Since: 1.4
func NewListWithData ¶
func NewListWithData(data binding.DataList, createItem func() fyne.CanvasObject, updateItem func(binding.DataItem, fyne.CanvasObject)) *List
NewListWithData creates a new list widget that will display the contents of the provided data.
Since: 2.0
func (*List) CreateRenderer ¶
func (l *List) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer.
func (*List) MinSize ¶
func (l *List) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below.
func (*List) Resize ¶
func (l *List) Resize(s fyne.Size)
Resize is called when this list should change size. We refresh to ensure invisible items are drawn.
func (*List) ScrollTo ¶
func (l *List) ScrollTo(id ListItemID)
ScrollTo scrolls to the item represented by id
Since: 2.1
func (*List) ScrollToBottom ¶
func (l *List) ScrollToBottom()
ScrollToBottom scrolls to the end of the list
Since: 2.1
func (*List) ScrollToTop ¶
func (l *List) ScrollToTop()
ScrollToTop scrolls to the start of the list
Since: 2.1
func (*List) Select ¶
func (l *List) Select(id ListItemID)
Select add the item identified by the given ID to the selection.
func (*List) SetItemHeight ¶
func (l *List) SetItemHeight(id ListItemID, height float32)
SetItemHeight supports changing the height of the specified list item. Items normally take the height of the template returned from the CreateItem callback. The height parameter uses the same units as a fyne.Size type and refers to the internal content height not including the divider size.
Since: 2.3
func (*List) Unselect ¶
func (l *List) Unselect(id ListItemID)
Unselect removes the item identified by the given ID from the selection.
func (*List) UnselectAll ¶
func (l *List) UnselectAll()
UnselectAll removes all items from the selection.
Since: 2.1
type ListSegment ¶
type ListSegment struct { Items []RichTextSegment Ordered bool }
ListSegment includes an itemised list with the content set using the Items field.
Since: 2.1
func (*ListSegment) Inline ¶
func (l *ListSegment) Inline() bool
Inline returns false as a list should be in a block.
func (*ListSegment) Segments ¶
func (l *ListSegment) Segments() []RichTextSegment
Segments returns the segments required to draw bullets before each item
func (*ListSegment) Select ¶
func (l *ListSegment) Select(_, _ fyne.Position)
Select does nothing for a list container.
func (*ListSegment) SelectedText ¶
func (l *ListSegment) SelectedText() string
SelectedText returns the empty string for this list.
func (*ListSegment) Textual ¶
func (l *ListSegment) Textual() string
Textual returns no content for a list as the content is in sub-segments.
func (*ListSegment) Unselect ¶
func (l *ListSegment) Unselect()
Unselect does nothing for a list container.
func (*ListSegment) Update ¶
func (l *ListSegment) Update(fyne.CanvasObject)
Update doesnt need to change a list visual.
func (*ListSegment) Visual ¶
func (l *ListSegment) Visual() fyne.CanvasObject
Visual returns no additional elements for this segment.
type Menu ¶
type Menu struct { BaseWidget Items []fyne.CanvasObject OnDismiss func() // contains filtered or unexported fields }
Menu is a widget for displaying a fyne.Menu.
func (*Menu) ActivateLastSubmenu ¶
ActivateLastSubmenu finds the last active menu item traversing through the open submenus and activates its submenu if any. It returns `true` if there was a submenu and it was activated and `false` elsewhere. Activating a submenu does show it and activate its first item.
func (*Menu) ActivateNext ¶
func (m *Menu) ActivateNext()
ActivateNext activates the menu item following the currently active menu item. If there is no menu item active, it activates the first menu item. If there is no menu item after the current active one, it does nothing. If a submenu is open, it delegates the activation to this submenu.
func (*Menu) ActivatePrevious ¶
func (m *Menu) ActivatePrevious()
ActivatePrevious activates the menu item preceding the currently active menu item. If there is no menu item active, it activates the last menu item. If there is no menu item before the current active one, it does nothing. If a submenu is open, it delegates the activation to this submenu.
func (*Menu) CreateRenderer ¶
func (m *Menu) CreateRenderer() fyne.WidgetRenderer
CreateRenderer returns a new renderer for the menu.
Implements: fyne.Widget
func (*Menu) DeactivateChild ¶
func (m *Menu) DeactivateChild()
DeactivateChild deactivates the active menu item and hides its submenu if any.
func (*Menu) DeactivateLastSubmenu ¶
DeactivateLastSubmenu finds the last open submenu traversing through the open submenus, deactivates its active item and hides it. This also deactivates any submenus of the deactivated submenu. It returns `true` if there was a submenu open and closed and `false` elsewhere.
func (*Menu) Dismiss ¶
func (m *Menu) Dismiss()
Dismiss dismisses the menu by dismissing and hiding the active child and performing OnDismiss.
func (*Menu) MinSize ¶
func (m *Menu) MinSize() fyne.Size
MinSize returns the minimal size of the menu.
Implements: fyne.Widget
func (*Menu) Refresh ¶
func (m *Menu) Refresh()
Refresh updates the menu to reflect changes in the data.
Implements: fyne.Widget
func (*Menu) Tapped ¶
func (m *Menu) Tapped(*fyne.PointEvent)
Tapped catches taps on separators and the menu background. It doesn't perform any action.
Implements: fyne.Tappable
func (*Menu) TriggerLast ¶
func (m *Menu) TriggerLast()
TriggerLast finds the last active menu item traversing through the open submenus and triggers it.
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 ParagraphSegment ¶
type ParagraphSegment struct {
Texts []RichTextSegment
}
ParagraphSegment wraps a number of text elements in a paragraph. It is similar to using a list of text elements when the final style is RichTextStyleParagraph.
Since: 2.1
func (*ParagraphSegment) Inline ¶
func (p *ParagraphSegment) Inline() bool
Inline returns false as a paragraph should be in a block.
func (*ParagraphSegment) Segments ¶
func (p *ParagraphSegment) Segments() []RichTextSegment
Segments returns the list of text elements in this paragraph.
func (*ParagraphSegment) Select ¶
func (p *ParagraphSegment) Select(_, _ fyne.Position)
Select does nothing for a paragraph container.
func (*ParagraphSegment) SelectedText ¶
func (p *ParagraphSegment) SelectedText() string
SelectedText returns the empty string for this paragraph container.
func (*ParagraphSegment) Textual ¶
func (p *ParagraphSegment) Textual() string
Textual returns no content for a paragraph container.
func (*ParagraphSegment) Unselect ¶
func (p *ParagraphSegment) Unselect()
Unselect does nothing for a paragraph container.
func (*ParagraphSegment) Update ¶
func (p *ParagraphSegment) Update(fyne.CanvasObject)
Update doesnt need to change a paragraph container.
func (*ParagraphSegment) Visual ¶
func (p *ParagraphSegment) Visual() fyne.CanvasObject
Visual returns the no extra elements.
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 (*PopUp) CreateRenderer ¶
func (p *PopUp) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*PopUp) MinSize ¶
func (p *PopUp) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*PopUp) Move ¶
func (p *PopUp) Move(pos fyne.Position)
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 ¶
func (p *PopUp) Resize(size fyne.Size)
Resize changes the size of the PopUp's content. PopUps always have the size of their canvas, but this call updates the size of the content portion.
Implements: fyne.Widget
func (*PopUp) ShowAtPosition ¶
func (p *PopUp) ShowAtPosition(pos fyne.Position)
ShowAtPosition shows this pop-up at the given position.
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 PopUpMenu ¶
type PopUpMenu struct { *Menu // contains filtered or unexported fields }
PopUpMenu is a Menu which displays itself in an OverlayContainer.
func NewPopUpMenu ¶
func NewPopUpMenu(menu *fyne.Menu, c fyne.Canvas) *PopUpMenu
NewPopUpMenu creates a new, reusable popup menu. You can show it using ShowAtPosition.
Since: 2.0
func (*PopUpMenu) FocusGained ¶
func (p *PopUpMenu) FocusGained()
FocusGained is triggered when the object gained focus. For the pop-up menu it does nothing.
Implements: fyne.Focusable
func (*PopUpMenu) FocusLost ¶
func (p *PopUpMenu) FocusLost()
FocusLost is triggered when the object lost focus. For the pop-up menu it does nothing.
Implements: fyne.Focusable
func (*PopUpMenu) Hide ¶
func (p *PopUpMenu) Hide()
Hide hides the pop-up menu.
Implements: fyne.Widget
func (*PopUpMenu) Move ¶
func (p *PopUpMenu) Move(pos fyne.Position)
Move moves the pop-up menu. The position is absolute because pop-up menus are shown in an overlay which covers the whole canvas.
Implements: fyne.Widget
func (*PopUpMenu) Resize ¶
func (p *PopUpMenu) Resize(size fyne.Size)
Resize changes the size of the pop-up menu.
Implements: fyne.Widget
func (*PopUpMenu) Show ¶
func (p *PopUpMenu) Show()
Show makes the pop-up menu visible.
Implements: fyne.Widget
func (*PopUpMenu) ShowAtPosition ¶
func (p *PopUpMenu) ShowAtPosition(pos fyne.Position)
ShowAtPosition shows the pop-up menu at the specified position.
type ProgressBar ¶
type ProgressBar struct { BaseWidget Min, Max, Value float64 // TextFormatter can be used to have a custom format of progress text. // If set, it overrides the percentage readout and runs each time the value updates. // // Since: 1.4 TextFormatter func() string `json:"-"` // contains filtered or unexported fields }
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 NewProgressBarWithData ¶
func NewProgressBarWithData(data binding.Float) *ProgressBar
NewProgressBarWithData returns a progress bar connected with the specified data source.
Since: 2.0
func (*ProgressBar) Bind ¶
func (p *ProgressBar) Bind(data binding.Float)
Bind connects the specified data source to this ProgressBar. The current value will be displayed and any changes in the data will cause the widget to update.
Since: 2.0
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.
func (*ProgressBar) Unbind ¶
func (p *ProgressBar) Unbind()
Unbind disconnects any configured data source from this ProgressBar. The current value will remain at the last value of the data source.
Since: 2.0
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 animation
func (*ProgressBarInfinite) Stop ¶
func (p *ProgressBarInfinite) Stop()
Stop the infinite progress bar animation
type RadioGroup ¶
type RadioGroup struct { DisableableWidget Horizontal bool Required bool OnChanged func(string) `json:"-"` Options []string Selected string // contains filtered or unexported fields }
RadioGroup widget has a list of text labels and checks check icons next to each. Changing the selection (only one can be selected) will trigger the changed func.
Since: 1.4
func NewRadioGroup ¶
func NewRadioGroup(options []string, changed func(string)) *RadioGroup
NewRadioGroup creates a new radio group widget with the set options and change handler
Since: 1.4
func (*RadioGroup) Append ¶
func (r *RadioGroup) Append(option string)
Append adds a new option to the end of a RadioGroup widget.
func (*RadioGroup) CreateRenderer ¶
func (r *RadioGroup) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*RadioGroup) MinSize ¶
func (r *RadioGroup) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*RadioGroup) Refresh ¶
func (r *RadioGroup) Refresh()
Refresh causes this widget to be redrawn in it's current state.
Implements: fyne.CanvasObject
func (*RadioGroup) SetSelected ¶
func (r *RadioGroup) SetSelected(option string)
SetSelected sets the radio option, it can be used to set a default option.
type RichText ¶
type RichText struct { BaseWidget Segments []RichTextSegment Wrapping fyne.TextWrap Scroll widget.ScrollDirection // contains filtered or unexported fields }
RichText represents the base element for a rich text-based widget.
Since: 2.1
func NewRichText ¶
func NewRichText(segments ...RichTextSegment) *RichText
NewRichText returns a new RichText widget that renders the given text and segments. If no segments are specified it will be converted to a single segment using the default text settings.
Since: 2.1
func NewRichTextFromMarkdown ¶
NewRichTextFromMarkdown configures a RichText widget by parsing the provided markdown content.
Since: 2.1
func NewRichTextWithText ¶
NewRichTextWithText returns a new RichText widget that renders the given text. The string will be converted to a single text segment using the default text settings.
Since: 2.1
func (*RichText) CreateRenderer ¶
func (t *RichText) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*RichText) MinSize ¶
func (t *RichText) MinSize() fyne.Size
MinSize calculates the minimum size of a rich text widget. This is based on the contained text with a standard amount of padding added.
func (*RichText) ParseMarkdown ¶
ParseMarkdown allows setting the content of this RichText widget from a markdown string. It will replace the content of this widget similarly to SetText, but with the appropriate formatting.
func (*RichText) Refresh ¶
func (t *RichText) Refresh()
Refresh triggers a redraw of the rich text.
Implements: fyne.Widget
type RichTextBlock ¶
type RichTextBlock interface {
Segments() []RichTextSegment
}
RichTextBlock is an extension of a text segment that contains other segments
Since: 2.1
type RichTextSegment ¶
type RichTextSegment interface { Inline() bool Textual() string Update(fyne.CanvasObject) Visual() fyne.CanvasObject Select(pos1, pos2 fyne.Position) SelectedText() string Unselect() }
RichTextSegment describes any element that can be rendered in a RichText widget.
Since: 2.1
type RichTextStyle ¶
type RichTextStyle struct { Alignment fyne.TextAlign ColorName fyne.ThemeColorName Inline bool SizeName fyne.ThemeSizeName TextStyle fyne.TextStyle // contains filtered or unexported fields }
RichTextStyle describes the details of a text object inside a RichText widget.
Since: 2.1
type Select ¶
type Select struct { DisableableWidget // Alignment sets the text alignment of the select and its list of options. // // Since: 2.1 Alignment fyne.TextAlign 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) ClearSelected ¶
func (s *Select) ClearSelected()
ClearSelected clears the current option of the select widget. After clearing the current option, the Select widget's PlaceHolder will be displayed.
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) FocusGained ¶
func (s *Select) FocusGained()
FocusGained is called after this Select has gained focus.
Implements: fyne.Focusable
func (*Select) FocusLost ¶
func (s *Select) FocusLost()
FocusLost is called after this Select has lost focus.
Implements: fyne.Focusable
func (*Select) MinSize ¶
func (s *Select) MinSize() fyne.Size
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) Move ¶
func (s *Select) Move(pos fyne.Position)
Move changes the relative position of the select.
Implements: fyne.Widget
func (*Select) Resize ¶
func (s *Select) 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 (*Select) SelectedIndex ¶
SelectedIndex returns the index value of the currently selected item in Options list. It will return -1 if there is no selection.
func (*Select) SetSelected ¶
SetSelected sets the current option of the select widget
func (*Select) SetSelectedIndex ¶
SetSelectedIndex will set the Selected option from the value in Options list at index position.
func (*Select) Tapped ¶
func (s *Select) Tapped(*fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any tap handler
type SelectEntry ¶
type SelectEntry struct { Entry // contains filtered or unexported fields }
SelectEntry is an input field which supports selecting from a fixed set of options.
func NewSelectEntry ¶
func NewSelectEntry(options []string) *SelectEntry
NewSelectEntry creates a SelectEntry.
func (*SelectEntry) CreateRenderer ¶
func (e *SelectEntry) CreateRenderer() fyne.WidgetRenderer
CreateRenderer returns a new renderer for this select entry.
Implements: fyne.Widget
func (*SelectEntry) Disable ¶
func (e *SelectEntry) Disable()
Disable this widget so that it cannot be interacted with, updating any style appropriately.
Implements: fyne.DisableableWidget
func (*SelectEntry) Enable ¶
func (e *SelectEntry) Enable()
Enable this widget, updating any style or features appropriately.
Implements: fyne.DisableableWidget
func (*SelectEntry) MinSize ¶
func (e *SelectEntry) MinSize() fyne.Size
MinSize returns the minimal size of the select entry.
Implements: fyne.Widget
func (*SelectEntry) Move ¶
func (e *SelectEntry) Move(pos fyne.Position)
Move changes the relative position of the select entry.
Implements: fyne.Widget
func (*SelectEntry) Resize ¶
func (e *SelectEntry) Resize(size fyne.Size)
Resize changes the size of the select entry.
Implements: fyne.Widget
func (*SelectEntry) SetOptions ¶
func (e *SelectEntry) SetOptions(options []string)
SetOptions sets the options the user might select from.
type Separator ¶
type Separator struct {
BaseWidget
}
Separator is a widget for displaying a separator with themeable color.
Since: 1.4
func (*Separator) CreateRenderer ¶
func (s *Separator) CreateRenderer() fyne.WidgetRenderer
CreateRenderer returns a new renderer for the separator.
Implements: fyne.Widget
type SeparatorSegment ¶
type SeparatorSegment struct {
// contains filtered or unexported fields
}
SeparatorSegment includes a horizontal separator in a rich text widget.
Since: 2.1
func (*SeparatorSegment) Inline ¶
func (s *SeparatorSegment) Inline() bool
Inline returns false as a separator should be full width.
func (*SeparatorSegment) Select ¶
func (s *SeparatorSegment) Select(_, _ fyne.Position)
Select does nothing for a separator.
func (*SeparatorSegment) SelectedText ¶
func (s *SeparatorSegment) SelectedText() string
SelectedText returns the empty string for this separator.
func (*SeparatorSegment) Textual ¶
func (s *SeparatorSegment) Textual() string
Textual returns no content for a separator element.
func (*SeparatorSegment) Unselect ¶
func (s *SeparatorSegment) Unselect()
Unselect does nothing for a separator.
func (*SeparatorSegment) Update ¶
func (s *SeparatorSegment) Update(fyne.CanvasObject)
Update doesnt need to change a separator visual.
func (*SeparatorSegment) Visual ¶
func (s *SeparatorSegment) Visual() fyne.CanvasObject
Visual returns the separator element for this segment.
type Slider ¶
type Slider struct { BaseWidget Value float64 Min float64 Max float64 Step float64 Orientation Orientation OnChanged func(float64) // contains filtered or unexported fields }
Slider is a widget that can slide between two fixed values.
func NewSliderWithData ¶
NewSliderWithData returns a slider connected with the specified data source.
Since: 2.0
func (*Slider) Bind ¶
Bind connects the specified data source to this Slider. The current value will be displayed and any changes in the data will cause the widget to update. User interactions with this Slider will set the value into the data source.
Since: 2.0
func (*Slider) CreateRenderer ¶
func (s *Slider) CreateRenderer() fyne.WidgetRenderer
CreateRenderer links this widget to its renderer.
func (*Slider) MinSize ¶
func (s *Slider) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
type Table ¶
type Table struct { BaseWidget Length func() (int, int) `json:"-"` CreateCell func() fyne.CanvasObject `json:"-"` UpdateCell func(id TableCellID, template fyne.CanvasObject) `json:"-"` OnSelected func(id TableCellID) `json:"-"` OnUnselected func(id TableCellID) `json:"-"` // contains filtered or unexported fields }
Table widget is a grid of items that can be scrolled and a cell selected. Its performance is provided by caching cell templates created with CreateCell and re-using them with UpdateCell. The size of the content rows/columns is returned by the Length callback.
Since: 1.4
func NewTable ¶
func NewTable(length func() (int, int), create func() fyne.CanvasObject, update func(TableCellID, fyne.CanvasObject)) *Table
NewTable returns a new performant table widget defined by the passed functions. The first returns the data size in rows and columns, second parameter is a function that returns cell template objects that can be cached and the third is used to apply data at specified data location to the passed template CanvasObject.
Since: 1.4
func (*Table) CreateRenderer ¶
func (t *Table) CreateRenderer() fyne.WidgetRenderer
CreateRenderer returns a new renderer for the table.
Implements: fyne.Widget
func (*Table) ScrollTo ¶
func (t *Table) ScrollTo(id TableCellID)
ScrollTo will scroll to the given cell without changing the selection. Attempting to scroll beyond the limits of the table will scroll to the edge of the table instead.
Since: 2.1
func (*Table) ScrollToBottom ¶
func (t *Table) ScrollToBottom()
ScrollToBottom scrolls to the last row in the table
Since: 2.1
func (*Table) ScrollToLeading ¶
func (t *Table) ScrollToLeading()
ScrollToLeading scrolls horizontally to the leading edge of the table
Since: 2.1
func (*Table) ScrollToTop ¶
func (t *Table) ScrollToTop()
ScrollToTop scrolls to the first row in the table
Since: 2.1
func (*Table) ScrollToTrailing ¶
func (t *Table) ScrollToTrailing()
ScrollToTrailing scrolls horizontally to the trailing edge of the table
Since: 2.1
func (*Table) Select ¶
func (t *Table) Select(id TableCellID)
Select will mark the specified cell as selected.
func (*Table) SetColumnWidth ¶
SetColumnWidth supports changing the width of the specified column. Columns normally take the width of the template cell returned from the CreateCell callback. The width parameter uses the same units as a fyne.Size type and refers to the internal content width not including the divider size.
Since: 1.4.1
func (*Table) SetRowHeight ¶
SetRowHeight supports changing the height of the specified row. Rows normally take the height of the template cell returned from the CreateCell callback. The height parameter uses the same units as a fyne.Size type and refers to the internal content height not including the divider size.
Since: 2.3
func (*Table) Unselect ¶
func (t *Table) Unselect(id TableCellID)
Unselect will mark the cell provided by id as unselected.
func (*Table) UnselectAll ¶
func (t *Table) UnselectAll()
UnselectAll will mark all cells as unselected.
Since: 2.1
type TableCellID ¶
TableCellID is a type that represents a cell's position in a table based on it's row and column location.
type TextGrid ¶
type TextGrid struct { BaseWidget Rows []TextGridRow ShowLineNumbers bool ShowWhitespace bool TabWidth int // If set to 0 the fyne.DefaultTabWidth is used }
TextGrid is a monospaced grid of characters. This is designed to be used by a text editor, code preview or terminal emulator.
func NewTextGridFromString ¶
NewTextGridFromString creates a new TextGrid widget with the specified string content.
func (*TextGrid) CreateRenderer ¶
func (t *TextGrid) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to it's renderer
func (*TextGrid) MinSize ¶
func (t *TextGrid) MinSize() fyne.Size
MinSize returns the smallest size this widget can shrink to
func (*TextGrid) Resize ¶
func (t *TextGrid) Resize(size fyne.Size)
Resize is called when this widget changes size. We should make sure that we refresh cells.
func (*TextGrid) Row ¶
func (t *TextGrid) Row(row int) TextGridRow
Row returns a copy of the content in a specified row as a TextGridRow. If the index is out of bounds it returns an empty row object.
func (*TextGrid) RowText ¶
RowText returns a string representation of the content at the row specified. If the index is out of bounds it returns an empty string.
func (*TextGrid) SetCell ¶
func (t *TextGrid) SetCell(row, col int, cell TextGridCell)
SetCell sets a grid data to the cell at named row and column.
func (*TextGrid) SetRow ¶
func (t *TextGrid) SetRow(row int, content TextGridRow)
SetRow updates the specified row of the grid's contents using the specified content and style and then refreshes. If the row is beyond the end of the current buffer it will be expanded. Tab characters are not padded with spaces.
func (*TextGrid) SetRowStyle ¶
func (t *TextGrid) SetRowStyle(row int, style TextGridStyle)
SetRowStyle sets a grid style to all the cells cell at the specified row. Any cells in this row with their own style will override this value when displayed.
func (*TextGrid) SetStyle ¶
func (t *TextGrid) SetStyle(row, col int, style TextGridStyle)
SetStyle sets a grid style to the cell at named row and column.
func (*TextGrid) SetStyleRange ¶
func (t *TextGrid) SetStyleRange(startRow, startCol, endRow, endCol int, style TextGridStyle)
SetStyleRange sets a grid style to all the cells between the start row and column through to the end row and column.
func (*TextGrid) SetText ¶
SetText updates the buffer of this textgrid to contain the specified text. New lines and columns will be added as required. Lines are separated by '\n'. The grid will use default text style and any previous content and style will be removed. Tab characters are padded with spaces to the next tab stop.
type TextGridCell ¶
type TextGridCell struct { Rune rune Style TextGridStyle }
TextGridCell represents a single cell in a text grid. It has a rune for the text content and a style associated with it.
type TextGridRow ¶
type TextGridRow struct { Cells []TextGridCell Style TextGridStyle }
TextGridRow represents a row of cells cell in a text grid. It contains the cells for the row and an optional style.
type TextGridStyle ¶
TextGridStyle defines a style that can be applied to a TextGrid cell.
var ( // TextGridStyleDefault is a default style for test grid cells TextGridStyleDefault TextGridStyle // TextGridStyleWhitespace is the style used for whitespace characters, if enabled TextGridStyleWhitespace TextGridStyle )
type TextSegment ¶
type TextSegment struct { Style RichTextStyle Text string }
TextSegment represents the styling for a segment of rich text.
Since: 2.1
func (*TextSegment) Inline ¶
func (t *TextSegment) Inline() bool
Inline should return true if this text can be included within other elements, or false if it creates a new block.
func (*TextSegment) Select ¶
func (t *TextSegment) Select(begin, end fyne.Position)
Select tells the segment that the user is selecting the content between the two positions.
func (*TextSegment) SelectedText ¶
func (t *TextSegment) SelectedText() string
SelectedText should return the text representation of any content currently selected through the Select call.
func (*TextSegment) Textual ¶
func (t *TextSegment) Textual() string
Textual returns the content of this segment rendered to plain text.
func (*TextSegment) Unselect ¶
func (t *TextSegment) Unselect()
Unselect tells the segment that the user is has cancelled the previous selection.
func (*TextSegment) Update ¶
func (t *TextSegment) Update(o fyne.CanvasObject)
Update applies the current state of this text segment to an existing visual.
func (*TextSegment) Visual ¶
func (t *TextSegment) Visual() fyne.CanvasObject
Visual returns the graphical elements required to render this segment.
type Toolbar ¶
type Toolbar struct { BaseWidget Items []ToolbarItem }
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 ¶
func (t *Toolbar) MinSize() fyne.Size
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 ¶
type ToolbarAction struct { Icon fyne.Resource OnActivated func() `json:"-"` }
ToolbarAction is push button style of ToolbarItem
func NewToolbarAction ¶
func NewToolbarAction(icon fyne.Resource, onActivated func()) *ToolbarAction
NewToolbarAction returns a new push button style ToolbarItem
func (*ToolbarAction) SetIcon ¶
func (t *ToolbarAction) SetIcon(icon fyne.Resource)
SetIcon updates the icon on a ToolbarItem
Since: 2.2
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
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 NewToolbarSeparator ¶
func NewToolbarSeparator() *ToolbarSeparator
NewToolbarSeparator returns a new separator item for a Toolbar to assist with ToolbarItem grouping
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 NewToolbarSpacer ¶
func NewToolbarSpacer() *ToolbarSpacer
NewToolbarSpacer returns a new spacer item for a Toolbar to assist with ToolbarItem alignment
func (*ToolbarSpacer) ToolbarObject ¶
func (t *ToolbarSpacer) ToolbarObject() fyne.CanvasObject
ToolbarObject gets the actual spacer object for this ToolbarSpacer
type Tree ¶
type Tree struct { BaseWidget Root TreeNodeID ChildUIDs func(uid TreeNodeID) (c []TreeNodeID) `json:"-"` // Return a sorted slice of Children TreeNodeIDs for the given Node TreeNodeID CreateNode func(branch bool) (o fyne.CanvasObject) `json:"-"` // Return a CanvasObject that can represent a Branch (if branch is true), or a Leaf (if branch is false) IsBranch func(uid TreeNodeID) (ok bool) `json:"-"` // Return true if the given TreeNodeID represents a Branch OnBranchClosed func(uid TreeNodeID) `json:"-"` // Called when a Branch is closed OnBranchOpened func(uid TreeNodeID) `json:"-"` // Called when a Branch is opened OnSelected func(uid TreeNodeID) `json:"-"` // Called when the Node with the given TreeNodeID is selected. OnUnselected func(uid TreeNodeID) `json:"-"` // Called when the Node with the given TreeNodeID is unselected. UpdateNode func(uid TreeNodeID, branch bool, node fyne.CanvasObject) `json:"-"` // Called to update the given CanvasObject to represent the data at the given TreeNodeID // contains filtered or unexported fields }
Tree widget displays hierarchical data. Each node of the tree must be identified by a Unique TreeNodeID.
Since: 1.4
func NewTree ¶
func NewTree(childUIDs func(TreeNodeID) []TreeNodeID, isBranch func(TreeNodeID) bool, create func(bool) fyne.CanvasObject, update func(TreeNodeID, bool, fyne.CanvasObject)) *Tree
NewTree returns a new performant tree widget defined by the passed functions. childUIDs returns the child TreeNodeIDs of the given node. isBranch returns true if the given node is a branch, false if it is a leaf. create returns a new template object that can be cached. update is used to apply data at specified data location to the passed template CanvasObject.
Since: 1.4
func NewTreeWithStrings ¶
NewTreeWithStrings creates a new tree with the given string map. Data must contain a mapping for the root, which defaults to empty string ("").
Since: 1.4
func (*Tree) CloseAllBranches ¶
func (t *Tree) CloseAllBranches()
CloseAllBranches closes all branches in the tree.
func (*Tree) CloseBranch ¶
func (t *Tree) CloseBranch(uid TreeNodeID)
CloseBranch closes the branch with the given TreeNodeID.
func (*Tree) CreateRenderer ¶
func (t *Tree) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer.
func (*Tree) IsBranchOpen ¶
func (t *Tree) IsBranchOpen(uid TreeNodeID) bool
IsBranchOpen returns true if the branch with the given TreeNodeID is expanded.
func (*Tree) MinSize ¶
func (t *Tree) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below.
func (*Tree) OpenAllBranches ¶
func (t *Tree) OpenAllBranches()
OpenAllBranches opens all branches in the tree.
func (*Tree) OpenBranch ¶
func (t *Tree) OpenBranch(uid TreeNodeID)
OpenBranch opens the branch with the given TreeNodeID.
func (*Tree) ScrollTo ¶
func (t *Tree) ScrollTo(uid TreeNodeID)
ScrollTo scrolls to the node with the given id.
Since 2.1
func (*Tree) ScrollToBottom ¶
func (t *Tree) ScrollToBottom()
ScrollToBottom scrolls to the bottom of the tree.
Since 2.1
func (*Tree) ScrollToTop ¶
func (t *Tree) ScrollToTop()
ScrollToTop scrolls to the top of the tree.
Since 2.1
func (*Tree) Select ¶
func (t *Tree) Select(uid TreeNodeID)
Select marks the specified node to be selected.
func (*Tree) ToggleBranch ¶
ToggleBranch flips the state of the branch with the given TreeNodeID.
func (*Tree) Unselect ¶
func (t *Tree) Unselect(uid TreeNodeID)
Unselect marks the specified node to be not selected.
func (*Tree) UnselectAll ¶
func (t *Tree) UnselectAll()
UnselectAll sets all nodes to be not selected.
Since: 2.1
Source Files ¶
- accordion.go
- bind_helper.go
- button.go
- card.go
- check.go
- check_group.go
- entry.go
- entry_cursor_anim.go
- entry_password.go
- entry_validation.go
- fileicon.go
- form.go
- hyperlink.go
- icon.go
- label.go
- list.go
- markdown.go
- menu.go
- menu_item.go
- menu_item_other.go
- pool.go
- popup.go
- popup_menu.go
- progressbar.go
- progressbarinfinite.go
- radio_group.go
- radio_item.go
- richtext.go
- richtext_objects.go
- select.go
- select_entry.go
- separator.go
- slider.go
- table.go
- textgrid.go
- toolbar.go
- tree.go
- widget.go