gioui.org: gioui.org/widget Index | Files | Directories

package widget

import "gioui.org/widget"

Package widget implements state tracking and event handling of common user interface controls. To draw widgets, use a theme packages such as package gioui.org/widget/material.

Index

Package Files

buffer.go button.go checkbox.go doc.go editor.go enum.go label.go

type Button Uses

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

func (*Button) Clicked Uses

func (b *Button) Clicked(gtx *layout.Context) bool

func (*Button) History Uses

func (b *Button) History() []Click

func (*Button) Layout Uses

func (b *Button) Layout(gtx *layout.Context)

type ChangeEvent Uses

type ChangeEvent struct{}

A ChangeEvent is generated for every user change to the text.

type CheckBox Uses

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

func (*CheckBox) Checked Uses

func (c *CheckBox) Checked(gtx *layout.Context) bool

func (*CheckBox) Layout Uses

func (c *CheckBox) Layout(gtx *layout.Context)

func (*CheckBox) SetChecked Uses

func (c *CheckBox) SetChecked(value bool)

type Click Uses

type Click struct {
    Position f32.Point
    Time     time.Time
}

Click represents a historic click.

type Editor Uses

type Editor struct {
    Alignment text.Alignment
    // SingleLine force the text to stay on a single line.
    // SingleLine also sets the scrolling direction to
    // horizontal.
    SingleLine bool
    // Submit enabled translation of carriage return keys to SubmitEvents.
    // If not enabled, carriage returns are inserted as newlines in the text.
    Submit bool
    // contains filtered or unexported fields
}

Editor implements an editable and scrollable text area.

func (*Editor) Events Uses

func (e *Editor) Events(gtx *layout.Context) []EditorEvent

Events returns available editor events.

func (*Editor) Focus Uses

func (e *Editor) Focus()

Focus requests the input focus for the Editor.

func (*Editor) Layout Uses

func (e *Editor) Layout(gtx *layout.Context, sh *text.Shaper, font text.Font)

Layout lays out the editor.

func (*Editor) Len Uses

func (e *Editor) Len() int

Len is the length of the editor contents.

func (*Editor) PaintCaret Uses

func (e *Editor) PaintCaret(gtx *layout.Context)

func (*Editor) PaintText Uses

func (e *Editor) PaintText(gtx *layout.Context)

func (*Editor) SetText Uses

func (e *Editor) SetText(s string)

SetText replaces the contents of the editor.

func (*Editor) Text Uses

func (e *Editor) Text() string

Text returns the contents of the editor.

type EditorEvent Uses

type EditorEvent interface {
    // contains filtered or unexported methods
}

type Enum Uses

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

func (*Enum) Layout Uses

func (rg *Enum) Layout(gtx *layout.Context, key string)

Layout adds the event handler for key.

func (*Enum) SetValue Uses

func (rg *Enum) SetValue(value string)

func (*Enum) Value Uses

func (e *Enum) Value(gtx *layout.Context) string

Value processes events and returns the last selected value, or the empty string.

type Label Uses

type Label struct {
    // Alignment specify the text alignment.
    Alignment text.Alignment
    // MaxLines limits the number of lines. Zero means no limit.
    MaxLines int
}

Label is a widget for laying out and drawing text.

func (Label) Layout Uses

func (l Label) Layout(gtx *layout.Context, s *text.Shaper, font text.Font, txt string)

type SubmitEvent Uses

type SubmitEvent struct {
    Text string
}

A SubmitEvent is generated when Submit is set and a carriage return key is pressed.

Directories

PathSynopsis
materialPackage material implements the Material design.

Package widget imports 18 packages (graph) and is imported by 4 packages. Updated 2019-11-19. Refresh now. Tools for package owners.