Documentation ¶
Index ¶
- Variables
- func ArgToolkit() string
- func Indent(b bool, a ...interface{})
- func StandardExit()
- func Watchdog()
- type ArgsGui
- type Grid
- type GridOffset
- type Node
- func (n *Node) AddText(str string) bool
- func (parent *Node) Append(n *Node)
- func (n *Node) AppendText(str string)
- func (n *Node) At(w int, h int) *Node
- func (n *Node) Bool() bool
- func (parent *Node) Box() *Node
- func (n *Node) Checked() bool
- func (n *Node) Children() []*Node
- func (n *Node) CloseToolkit(name string) bool
- func (n *Node) Default() *Node
- func (n *Node) Delete(d *Node)
- func (n *Node) Disable() *Node
- func (n *Node) Draw() *Node
- func (n *Node) Dump()
- func (n *Node) Enable() *Node
- func (n *Node) Expand() *Node
- func (n *Node) GetProgName() string
- func (n *Node) Hidden() bool
- func (n *Node) Hide() *Node
- func (n *Node) Horizontal() *Node
- func (n *Node) InitEmbed(resFS embed.FS) *Node
- func (n *Node) Int() int
- func (n *Node) IsMirror() bool
- func (n *Node) ListChildren(dump bool)
- func (n *Node) ListToolkits()
- func (n *Node) LoadToolkit(name string) *Node
- func (n *Node) LoadToolkitEmbed(name string, b []byte) *Node
- func (n *Node) Margin() *Node
- func (parent *Node) Mirror(m *Node) *Node
- func (parent *Node) NewBox(progname string, b bool) *Node
- func (parent *Node) NewButton(name string, custom func()) *Node
- func (parent *Node) NewCheckbox(name string) *Node
- func (parent *Node) NewCombobox() *Node
- func (parent *Node) NewDropdown() *Node
- func (parent *Node) NewEntryLine(name string) *Node
- func (parent *Node) NewEntrybox(name string) *Node
- func (parent *Node) NewGrid(progname string, w int, h int) *Node
- func (parent *Node) NewGroup(name string) *Node
- func (parent *Node) NewHorizontalBox(progname string) *Node
- func (parent *Node) NewImage(name string) *Node
- func (parent *Node) NewLabel(text string) *Node
- func (parent *Node) NewSeparator(progname string) *Node
- func (parent *Node) NewSlider(progname string, x int, y int) *Node
- func (parent *Node) NewSpinner(progname string, x int, y int) *Node
- func (parent *Node) NewTextbox(name string) *Node
- func (parent *Node) NewVerticalBox(progname string) *Node
- func (parent *Node) NewWindow(title string) *Node
- func (n *Node) NextRow() *Node
- func (n *Node) Pad() *Node
- func (n *Node) Parent() *Node
- func (n *Node) ParentVisable() bool
- func (parent *Node) RawGrid() *Node
- func (parent *Node) RawWindow(title string) *Node
- func (n *Node) Ready() bool
- func (n *Node) SetBool(b bool)
- func (n *Node) SetChecked(b bool) *Node
- func (n *Node) SetExpand(b bool) *Node
- func (n *Node) SetInt(i int)
- func (n *Node) SetLabel(label string) *Node
- func (n *Node) SetProgName(s string) *Node
- func (n *Node) SetText(text string) *Node
- func (n *Node) SetVisable(b bool)
- func (n *Node) Show() *Node
- func (n *Node) StandardClose()
- func (n *Node) StandardExit()
- func (n *Node) String() string
- func (n *Node) Strings() []string
- func (n *Node) TestDraw()
- func (n *Node) Unmargin() *Node
- func (n *Node) Unpad() *Node
- func (n *Node) Vertical() *Node
- func (n *Node) WindowVisable() bool
- type RangeMovedToWidget
- type Symbol
Constants ¶
This section is empty.
Variables ¶
var GUIVERSION string
Functions ¶
func ArgToolkit ¶
func ArgToolkit() string
used for command line options. This allows you to control the toolkit settings from the command line
--debugger # opens the debugger --gui andlabs # loads the GTK toolkit on linux or Cocoa on mac --gui gocui # runs your program in the terminal in ncurses-like mode
func StandardExit ¶
func StandardExit()
The window is destroyed and the application exits TODO: properly exit the plugin since Quit() doesn't do it
func Watchdog ¶
func Watchdog()
This program sits here. This goroutine can be used like a watchdog timer TODO: handle toolkit panics here?
Types ¶
type ArgsGui ¶
type ArgsGui struct { GuiPlugin string `arg:"--gui" help:"Use this gui toolkit [andlabs,gocui,nocui]"` GuiVerbose bool `arg:"--gui-verbose" help:"enable all logging"` }
This struct can be used with the go-arg package. These are the generic default command line arguments for the 'GUI' package
type Node ¶
type Node struct { WidgetType widget.WidgetType // this function is run when there are mouse or keyboard events Custom func() // used for anything that needs a range (for example: a slider) X int Y int // the grid widget max width and height // the max height can be implemented in the toolkit plugin // to restrict the number of rows to display W int H int // where the next widget should be put in this grid NextW int NextH int // if this widget is in a grid, this is the position of a widget AtW int AtH int // contains filtered or unexported fields }
func New ¶
func New() *Node
There should only be one of these per application This is due to restrictions by being cross platform some toolkit's on some operating systems don't support more than one Keep things simple. Do the default expected thing whenever possible
func NewWindow ¶ added in v0.20.5
This creates a window off the root of the binary tree
func RawBox ¶ added in v0.20.8
func RawBox() *Node
this is an experiment. I like to think of this package like 'Sierpinski' It's like it's in a fractional dimension because it doesn't exist the toolkits are the things that make it visible to us. Here, we can think abstractly about how the data is formed make something that can't be seen at all
func RawMirror ¶ added in v0.20.8
make a mirror widget without a parent
func TreeRoot ¶
func TreeRoot() *Node
returns the root of the binary tree change the names to 'Tree' as I think the name is better
func (*Node) AddText ¶
add a new text string to widgets that support multiple string values These must be unique. return false if the string already exists
func (*Node) AppendText ¶
appends text to the existing text TODO: this is an experiement
func (*Node) Default ¶
try to load andlabs, if that doesn't work, fall back to the console
func (*Node) Disable ¶
disables a widget so the user can see it, but can not interact or change it.
func (*Node) Enable ¶
enables a widget so the user can see it and work/click/etc on it by default, widgets are enabled when they are created
func (*Node) ListChildren ¶
func (n *Node) ListChildren(dump bool, dropdown *Node, mapNodes map[string]*Node) {
func (*Node) Mirror ¶ added in v0.20.8
an experiemental idea basically, this is like a cell in a spreadsheet that is viable in one place but also exists sonewhere else
func (*Node) NewGroup ¶
TODO: make a "Group" a "Grid" ? probably since right now group is just a pre-canned andlabs/ui gtk,macos,windows thing
func (*Node) ParentVisable ¶
returns true if the parent is not visable to the user in which case events are not sent to the toolkit
func (*Node) RawWindow ¶
allow window create without actually sending it to the toolkit
func (*Node) SetLabel ¶
This will set the visable name for widgets that have text displayed that is not editable by the user For example, a button, window, group, checkbox
func (*Node) SetProgName ¶
should get the reference name used for programming and debugging
TODO: ensure these are unique and make a way to look them up myButton = myGroup.NewButton("hit ball", nil).SetName("HIT") myButton.GetName() should return "HIT" n = Find("HIT") should return myButton
func (*Node) SetText ¶
What "SetText" means depends on the type of widget should this be a different name?
func (*Node) StandardClose ¶
func (n *Node) StandardClose()
The window is destroyed but the application does not quit
func (*Node) StandardExit ¶
func (n *Node) StandardExit()
The window is destroyed and the application exits TODO: properly exit the plugin since Quit() doesn't do it
type RangeMovedToWidget ¶
Range(1, 10) includes the values 1 and 10 almost all toolkits use integers so there doesn't seem to be a good idea to use 'type any' here as it just makes things more complicated for no good reason