gadgets

package module
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: BSD-3-Clause Imports: 5 Imported by: 19

README

gadgets

Package gadgets are special collections of widgets

Things to avoid or keep in mind: Also Features these might enable:

* These should never bypass the binary tree
* Hide complexity internally here
* These might require corresponding toolkit implementations?
* These might allow unique/good corresponding toolkit implementations (date/time selection?)

## Warning

Doing this / adding these might be a really bad idea that I will regret later

Documentation

Overview

A Labeled Combobox widget:

----------------------------- | | | | Food: | <dropdown> | | | | -----------------------------

The user can then edit the dropdown field and type anything into it

A Labeled Dropdown widget:

----------------------------- | | | | Food: | <dropdown> | | | | -----------------------------

This being a 'Basic Dropdown', the dropdown names must be unique

A Labeled Single Line Entry widget:

----------------------------- | | | | Food: | <type here> | | | | -----------------------------

A Labeled label:

----------------------------- | | | | Food: | Apple | | | | -----------------------------

A Standard Window

A simple GUI gadget to control on a 'log' package flag

----------------------------------------------- | | | | [ X ] | INFO (controls log.Info() | | | | -----------------------------------------------

A Labeled label:

----------------------------- | | | | Food: | Apple | | | | -----------------------------

Index

Constants

This section is empty.

Variables

View Source
var GADGETS *log.LogFlag

Functions

This section is empty.

Types

type BasicCombobox

type BasicCombobox struct {
	Custom func()
	// contains filtered or unexported fields
}

func NewBasicCombobox

func NewBasicCombobox(p *gui.Node, label string) *BasicCombobox

func (*BasicCombobox) AddText

func (d *BasicCombobox) AddText(s string)

func (*BasicCombobox) Disable

func (d *BasicCombobox) Disable()

func (*BasicCombobox) Enable

func (d *BasicCombobox) Enable()

func (*BasicCombobox) Hide

func (n *BasicCombobox) Hide()

func (*BasicCombobox) Ready

func (d *BasicCombobox) Ready() bool

Returns true if the status is valid

func (*BasicCombobox) SetText

func (d *BasicCombobox) SetText(s string)

func (*BasicCombobox) SetTitle

func (d *BasicCombobox) SetTitle(name string)

func (*BasicCombobox) Show

func (n *BasicCombobox) Show()

func (*BasicCombobox) String

func (d *BasicCombobox) String() string

type BasicDropdown

type BasicDropdown struct {
	Custom func()
	// contains filtered or unexported fields
}

func NewBasicDropdown

func NewBasicDropdown(p *gui.Node, name string) *BasicDropdown

func (*BasicDropdown) AddText

func (d *BasicDropdown) AddText(s string)

func (*BasicDropdown) Ready

func (d *BasicDropdown) Ready() bool

Returns true if the status is valid

func (*BasicDropdown) SetLabel

func (d *BasicDropdown) SetLabel(value string) bool

func (*BasicDropdown) SetText

func (d *BasicDropdown) SetText(s string)

func (*BasicDropdown) String

func (d *BasicDropdown) String() string

type BasicEntry

type BasicEntry struct {
	Custom func()
	// contains filtered or unexported fields
}

func NewBasicEntry

func NewBasicEntry(p *gui.Node, name string) *BasicEntry

func (*BasicEntry) Disable

func (n *BasicEntry) Disable()

func (*BasicEntry) Enable

func (n *BasicEntry) Enable()

func (*BasicEntry) Hide

func (n *BasicEntry) Hide()

func (*BasicEntry) SetLabel

func (n *BasicEntry) SetLabel(s string) *BasicEntry

func (*BasicEntry) SetText

func (n *BasicEntry) SetText(s string) *BasicEntry

func (*BasicEntry) Show

func (n *BasicEntry) Show()

func (*BasicEntry) String

func (n *BasicEntry) String() string

type BasicLabel

type BasicLabel struct {
	Custom func()
	// contains filtered or unexported fields
}

type BasicWindow

type BasicWindow struct {
	Custom func()
	// contains filtered or unexported fields
}

func NewBasicWindow

func NewBasicWindow(parent *gui.Node, title string) *BasicWindow

func RawBasicWindow added in v0.20.1

func RawBasicWindow(title string) *BasicWindow

func (*BasicWindow) Box

func (w *BasicWindow) Box() *gui.Node

func (*BasicWindow) Disable

func (w *BasicWindow) Disable()

func (*BasicWindow) Draw

func (w *BasicWindow) Draw()

func (*BasicWindow) Enable

func (w *BasicWindow) Enable()

func (*BasicWindow) Hidden added in v0.20.3

func (w *BasicWindow) Hidden() bool

func (*BasicWindow) Hide

func (w *BasicWindow) Hide()

func (*BasicWindow) Horizontal

func (w *BasicWindow) Horizontal()

func (*BasicWindow) Initialized

func (w *BasicWindow) Initialized() bool

Returns true if initialized

func (*BasicWindow) Make

func (w *BasicWindow) Make() *BasicWindow

func (*BasicWindow) Ready

func (w *BasicWindow) Ready() bool

Returns true if the status is valid

func (*BasicWindow) SetLabel

func (w *BasicWindow) SetLabel(title string)

func (*BasicWindow) SetTitle

func (w *BasicWindow) SetTitle(title string)

func (*BasicWindow) Show

func (w *BasicWindow) Show()

func (*BasicWindow) StandardClose

func (w *BasicWindow) StandardClose()

sets this window to run os.Exit()

func (*BasicWindow) StandardExit

func (w *BasicWindow) StandardExit()

sets this window to run os.Exit()

func (*BasicWindow) TestDraw

func (w *BasicWindow) TestDraw()

func (*BasicWindow) Toggle

func (w *BasicWindow) Toggle()

func (*BasicWindow) Vertical

func (w *BasicWindow) Vertical()

type Duration

type Duration struct {
	Label    string
	Low      time.Duration
	High     time.Duration
	Duration time.Duration

	Custom func()
	// contains filtered or unexported fields
}

func NewDurationSlider

func NewDurationSlider(n *gui.Node, label string, low time.Duration, high time.Duration) *Duration

func (*Duration) Set

func (n *Duration) Set(d time.Duration)

type LogFlag

type LogFlag struct {
	Custom func()
	// contains filtered or unexported fields
}

func NewLogFlag

func NewLogFlag(n *gui.Node, lf *log.LogFlag) *LogFlag

func (*LogFlag) Bool

func (f *LogFlag) Bool() bool

probably a better name than GetValue()

func (*LogFlag) GetDesc

func (f *LogFlag) GetDesc() string

func (*LogFlag) GetName

func (f *LogFlag) GetName() string

func (*LogFlag) GetSubsystem

func (f *LogFlag) GetSubsystem() string

func (*LogFlag) GetValue

func (f *LogFlag) GetValue() bool

func (*LogFlag) RestoreDefault

func (f *LogFlag) RestoreDefault()

should be RestoreDefault() ?

func (*LogFlag) SetValue

func (f *LogFlag) SetValue(b bool)

type Node

type Node gui.Node

func (*Node) NewBasicLabel

func (ngui *Node) NewBasicLabel(name string) *BasicLabel

type OneLiner

type OneLiner struct {
	Custom func()
	// contains filtered or unexported fields
}

func NewOneLiner

func NewOneLiner(n *gui.Node, label string) *OneLiner

func (*OneLiner) Disable

func (n *OneLiner) Disable()

func (*OneLiner) Enable

func (n *OneLiner) Enable()

func (*OneLiner) Hide

func (n *OneLiner) Hide()

func (*OneLiner) MirrorLabel added in v0.20.8

func (n *OneLiner) MirrorLabel() *gui.Node

returns a widget of the last tag that acts as a mirror

func (*OneLiner) MirrorValue added in v0.20.8

func (n *OneLiner) MirrorValue() *gui.Node

returns a widget of the last tag that acts as a mirror

func (*OneLiner) SetLabel

func (n *OneLiner) SetLabel(value string) *OneLiner

func (*OneLiner) SetText

func (n *OneLiner) SetText(s string) *OneLiner

func (*OneLiner) SetValue

func (n *OneLiner) SetValue(s string) *OneLiner

func (*OneLiner) Show added in v0.20.4

func (n *OneLiner) Show()

func (*OneLiner) String

func (n *OneLiner) String() string

Jump to

Keyboard shortcuts

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