widget

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2024 License: BSD-3-Clause Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	widget.Button
	ToolTipWidgetExtend
}

Button widget has a text label and triggers an event func when clicked

func NewButton

func NewButton(text string, onTapped func()) *Button

NewButton creates a new button widget with the set label and tap handler

func NewButtonWithIcon

func NewButtonWithIcon(text string, icon fyne.Resource, onTapped func()) *Button

NewButtonWithIcon creates a new button widget with the specified label, themed icon and tap handler

func (*Button) ExtendBaseWidget

func (b *Button) ExtendBaseWidget(wid fyne.Widget)

func (*Button) MouseIn

func (b *Button) MouseIn(e *desktop.MouseEvent)

func (*Button) MouseMoved

func (b *Button) MouseMoved(e *desktop.MouseEvent)

func (*Button) MouseOut

func (b *Button) MouseOut()

type Check

type Check struct {
	widget.Check
	ToolTipWidgetExtend
}

Check widget has a text label and a checked (or unchecked) icon and triggers an event func when toggled

func NewCheck

func NewCheck(label string, changed func(bool)) *Check

NewCheck creates a new check widget with the set label and change handler

func NewCheckWithData

func NewCheckWithData(label string, data binding.Bool) *Check

NewCheckWithData returns a check widget connected with the specified data source.

func (*Check) ExtendBaseWidget

func (c *Check) ExtendBaseWidget(wid fyne.Widget)

func (*Check) MouseIn

func (c *Check) MouseIn(e *desktop.MouseEvent)

func (*Check) MouseMoved

func (c *Check) MouseMoved(e *desktop.MouseEvent)

func (*Check) MouseOut

func (c *Check) MouseOut()
type Hyperlink struct {
	widget.Hyperlink
	ToolTipWidgetExtend
}

Hyperlink widget is a text component with appropriate padding and layout. When clicked, the default web browser should open with a URL

func NewHyperlink(text string, url *url.URL) *Hyperlink

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) ExtendBaseWidget

func (l *Hyperlink) ExtendBaseWidget(wid fyne.Widget)

func (*Hyperlink) MouseIn

func (l *Hyperlink) MouseIn(e *desktop.MouseEvent)

func (*Hyperlink) MouseMoved

func (l *Hyperlink) MouseMoved(e *desktop.MouseEvent)

func (*Hyperlink) MouseOut

func (l *Hyperlink) MouseOut()

type Label

type Label struct {
	widget.Label
	ToolTipWidgetExtend

	// Sets a callback that will be invoked for MouseIn events received
	OnMouseIn func(*desktop.MouseEvent)
	// Sets a callback that will be invoked for MouseMoved events received
	OnMouseMoved func(*desktop.MouseEvent)
	// Sets a callback that will be invoked for MouseOut events received
	OnMouseOut func()
}

Label widget is a label component with appropriate padding and layout.

NOTE: since the tool tip label implements desktop.Hoverable while the standard Label does not, this widget may result in hover events not reaching the parent Hoverable widget. It provides a callback API to allow parent widgets to be notified of hover events received on this widget.

func NewLabel

func NewLabel(text string) *Label

NewLabel creates a new label widget with the set text content

func NewLabelWithData

func NewLabelWithData(data binding.String) *Label

NewLabelWithData returns an Label widget connected to the specified data source.

func NewLabelWithStyle

func NewLabelWithStyle(text string, alignment fyne.TextAlign, style fyne.TextStyle) *Label

NewLabelWithStyle creates a new label widget with the set text content

func (*Label) ExtendBaseWidget

func (l *Label) ExtendBaseWidget(wid fyne.Widget)

func (*Label) MouseIn added in v0.2.0

func (l *Label) MouseIn(e *desktop.MouseEvent)

func (*Label) MouseMoved added in v0.2.0

func (l *Label) MouseMoved(e *desktop.MouseEvent)

func (*Label) MouseOut added in v0.2.0

func (l *Label) MouseOut()

type ProgressBar

type ProgressBar struct {
	widget.ProgressBar
	ToolTipWidgetExtend
}

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.

func (*ProgressBar) ExtendBaseWidget

func (p *ProgressBar) ExtendBaseWidget(wid fyne.Widget)

type ProgressBarInfinite

type ProgressBarInfinite struct {
	widget.ProgressBarInfinite
	ToolTipWidgetExtend
}

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) ExtendBaseWidget

func (p *ProgressBarInfinite) ExtendBaseWidget(wid fyne.Widget)

type RichText

type RichText struct {
	widget.RichText
	ToolTipWidgetExtend

	// Sets a callback that will be invoked for MouseIn events received
	OnMouseIn func(*desktop.MouseEvent)
	// Sets a callback that will be invoked for MouseMoved events received
	OnMouseMoved func(*desktop.MouseEvent)
	// Sets a callback that will be invoked for MouseOut events received
	OnMouseOut func()
}

RichText represents the base element for a rich text-based widget.

NOTE: since the tool tip RichText implements desktop.Hoverable while the standard RichText does not, this widget may result in hover events not reaching the parent Hoverable widget. It provides a callback API to allow parent widgets to be notified of hover events received on this widget.

func NewRichText

func NewRichText(segments ...widget.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.

func NewRichTextWithText

func NewRichTextWithText(text string) *RichText

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.

func (*RichText) ExtendBaseWidget

func (r *RichText) ExtendBaseWidget(wid fyne.Widget)

func (*RichText) MouseIn added in v0.2.0

func (r *RichText) MouseIn(e *desktop.MouseEvent)

func (*RichText) MouseMoved added in v0.2.0

func (r *RichText) MouseMoved(e *desktop.MouseEvent)

func (*RichText) MouseOut added in v0.2.0

func (r *RichText) MouseOut()

type Select

type Select struct {
	widget.Select
	ToolTipWidgetExtend
}

Select widget has a list of options, with the current one shown, and triggers an event func when clicked

func NewSelect

func NewSelect(options []string, changed func(string)) *Select

NewSelect creates a new select widget with the set list of options and changes handler

func (*Select) ExtendBaseWidget

func (s *Select) ExtendBaseWidget(wid fyne.Widget)

func (*Select) MouseIn

func (s *Select) MouseIn(e *desktop.MouseEvent)

func (*Select) MouseMoved

func (s *Select) MouseMoved(e *desktop.MouseEvent)

func (*Select) MouseOut

func (s *Select) MouseOut()

type Slider

type Slider struct {
	widget.Slider
	ToolTipWidgetExtend
}

Slider is a widget that can slide between two fixed values.

func NewSlider

func NewSlider(min, max float64) *Slider

NewSlider returns a basic slider.

func NewSliderWithData

func NewSliderWithData(min, max float64, data binding.Float) *Slider

NewSliderWithData returns a slider connected with the specified data source.

func (*Slider) ExtendBaseWidget

func (s *Slider) ExtendBaseWidget(wid fyne.Widget)

func (*Slider) MouseIn

func (s *Slider) MouseIn(e *desktop.MouseEvent)

func (*Slider) MouseMoved

func (s *Slider) MouseMoved(e *desktop.MouseEvent)

func (*Slider) MouseOut

func (s *Slider) MouseOut()

type ToolTipWidget

type ToolTipWidget struct {
	widget.BaseWidget
	// contains filtered or unexported fields
}

ToolTipWidget is a base struct for building new tool tip supporting widgets. Inherit from this struct instead of from `widget.BaseWidget` to automatically add tool tip support to your widget.

func (*ToolTipWidget) ExtendBaseWidget added in v0.1.1

func (t *ToolTipWidget) ExtendBaseWidget(wid fyne.Widget)

func (*ToolTipWidget) MouseIn

func (t *ToolTipWidget) MouseIn(e *desktop.MouseEvent)

func (*ToolTipWidget) MouseMoved

func (t *ToolTipWidget) MouseMoved(e *desktop.MouseEvent)

func (*ToolTipWidget) MouseOut

func (t *ToolTipWidget) MouseOut()

func (*ToolTipWidget) SetToolTip

func (t *ToolTipWidget) SetToolTip(toolTip string)

func (*ToolTipWidget) ToolTip

func (t *ToolTipWidget) ToolTip() string

type ToolTipWidgetExtend

type ToolTipWidgetExtend struct {

	// Obj is the widget this ToolTipWidgetExtend is embedded in; set by ExtendToolTipWidget
	Obj fyne.CanvasObject
	// contains filtered or unexported fields
}

ToolTipWidgetExtend is a struct for extending existing widgets for tool tip support. Use this to extend existing widgets for tool tip support. When creating an extended widget with ToolTipWidgetExtend you must override ExtendBaseWidget to call both the ExtendBaseWidget implementation of the parent widget, and ExtendToolTipWidget.

func (*ToolTipWidgetExtend) ExtendToolTipWidget

func (t *ToolTipWidgetExtend) ExtendToolTipWidget(wid fyne.Widget)

ExtendToolTipWidget sets up a tool tip extended widget.

func (*ToolTipWidgetExtend) MouseIn

func (t *ToolTipWidgetExtend) MouseIn(e *desktop.MouseEvent)

func (*ToolTipWidgetExtend) MouseMoved

func (t *ToolTipWidgetExtend) MouseMoved(e *desktop.MouseEvent)

func (*ToolTipWidgetExtend) MouseOut

func (t *ToolTipWidgetExtend) MouseOut()

func (*ToolTipWidgetExtend) SetToolTip

func (t *ToolTipWidgetExtend) SetToolTip(toolTip string)

func (*ToolTipWidgetExtend) ToolTip

func (t *ToolTipWidgetExtend) ToolTip() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL