radiobutton

package
v0.0.0-...-af996ba Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StdTheme is the theme all new RadioButtons get by default.
	StdTheme = NewTheme()
)

Functions

This section is empty.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group is used to ensure only one RadioButton in a group is selected at a time.

func NewGroup

func NewGroup(buttons ...*RadioButton) *Group

NewGroup creates a new group for the specified buttons. Each button is removed from any other group it may be in and placed in the newly created one.

func (*Group) Add

func (g *Group) Add(button *RadioButton)

Add a button to the group, removing it from any group it may have previously been associated with.

func (*Group) Remove

func (g *Group) Remove(button *RadioButton)

Remove a button from the group.

func (*Group) Select

func (g *Group) Select(button *RadioButton)

Select a button, deselecting all others in the group.

type RadioButton

type RadioButton struct {
	widget.Block
	Theme *Theme // The theme the button will use to draw itself.
	Title string // An optional title for the button.
	// contains filtered or unexported fields
}

RadioButton represents a radio button with an optional label.

func New

func New(title string) *RadioButton

New creates a new radio button with the specified title.

func (*RadioButton) BaseBackground

func (button *RadioButton) BaseBackground() color.Color

BaseBackground returns this button's current base background color.

func (*RadioButton) Click

func (button *RadioButton) Click()

Click performs any animation associated with a click and calls the OnClick() function if it is set.

func (*RadioButton) Selected

func (button *RadioButton) Selected() bool

Selected returns true if the radio button is currently selected.

func (*RadioButton) SetSelected

func (button *RadioButton) SetSelected(selected bool)

SetSelected sets the button's selected state.

func (*RadioButton) Sizes

func (button *RadioButton) Sizes(hint geom.Size) (min, pref, max geom.Size)

Sizes implements Sizer

func (*RadioButton) TextColor

func (button *RadioButton) TextColor() color.Color

TextColor returns this button's current text color.

type Theme

type Theme struct {
	button.BaseTextTheme
	HorizontalGap float64 // The gap between the radio button graphic and its label.
}

Theme contains the theme elements for RadioButtons.

func NewTheme

func NewTheme() *Theme

NewTheme creates a new radio button theme.

func (*Theme) Init

func (theme *Theme) Init()

Init initializes the theme with its default values.

Jump to

Keyboard shortcuts

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