checkbox

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 (
	// StdCheckBox is the theme all new CheckBoxes get by default.
	StdCheckBox = NewTheme()
)

Functions

This section is empty.

Types

type CheckBox

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

CheckBox represents a clickable checkbox with an optional label.

func NewCheckBox

func NewCheckBox(title string) *CheckBox

NewCheckBox creates a new checkbox with the specified title.

func (*CheckBox) BaseBackground

func (checkbox *CheckBox) BaseBackground() color.Color

BaseBackground returns this checkbox's current base background color.

func (*CheckBox) Click

func (checkbox *CheckBox) Click()

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

func (*CheckBox) SetState

func (checkbox *CheckBox) SetState(state State)

SetState sets the checkbox's state.

func (*CheckBox) Sizes

func (checkbox *CheckBox) Sizes(hint geom.Size) (min, pref, max geom.Size)

Sizes implements Sizer

func (*CheckBox) State

func (checkbox *CheckBox) State() State

State returns this checkbox's current state.

func (*CheckBox) TextColor

func (checkbox *CheckBox) TextColor() color.Color

TextColor returns this checkbox's current text color.

type State

type State int

State represents the current state of the checkbox.

const (
	Unchecked State = iota
	Mixed
	Checked
)

Possible values for State.

type Theme

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

Theme contains the theme elements for CheckBoxes.

func NewTheme

func NewTheme() *Theme

NewTheme creates a new checkbox 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