Documentation ¶
Index ¶
- Variables
- type Group
- type RadioButton
- func (button *RadioButton) BaseBackground() color.Color
- func (button *RadioButton) Click()
- func (button *RadioButton) Selected() bool
- func (button *RadioButton) SetSelected(selected bool)
- func (button *RadioButton) Sizes(hint geom.Size) (min, pref, max geom.Size)
- func (button *RadioButton) TextColor() color.Color
- type Theme
Constants ¶
This section is empty.
Variables ¶
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) 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.