golib

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: BSD-3-Clause Imports: 11 Imported by: 2

README

ProntoGUI

The FAST way to build a GUI — in Go.

Build a desktop GUI for your Go service or program without learning React, Flutter, Qt, or any other frontend stack. Write your UI directly in Go and let the ProntoGUI App render it on macOS or Windows.

ProntoGUI demo

Go Reference


Why ProntoGUI?

Modern GUI development is fragmented across React, React Native, .NET, Qt, Flutter, and more. If you write Go, shipping a GUI usually means either learning a whole frontend stack or waiting on a frontend developer.

ProntoGUI removes that barrier:

  • Stay in Go. Define your GUI with plain Go types — no JavaScript, no XAML, no QML.
  • Skip the frontend. A pre-built native App renders your GUI. You ship a single Go binary; users install the App once.
  • Streaming, not request/response. The GUI is live — set primitives, wait for events, update state, repeat.

Ideal for internal tools, manufacturing/lab apps, ERP front-ends, simulators, and any Go service that needs a visual front-end without the frontend team.

Install

go get github.com/prontogui/golib

Requires Go 1.23+.

Quickstart

1. Install the ProntoGUI App. Your Go program is the server; the App is the renderer. App is available for macOS and Windows through the early access program with an official launch soon ProntoGUI Early Access Request.

2. Write your program:

package main

import (
    "log"

    "github.com/prontogui/golib"
)

func main() {
    pgui := golib.NewProntoGUI()
    if err := pgui.StartServingSingle("127.0.0.1", 50053); err != nil {
        log.Fatal(err)
    }

    greeting := golib.NewText("Hello from Go!")
    button := golib.CommandWith{Label: "Click me"}.Make()

    pgui.SetGUI(greeting, button)

    for {
        updated, err := pgui.Wait()
        if err != nil {
            log.Fatal(err)
        }
        if updated == button {
            greeting.SetContent("Button clicked!")
        }
    }
}

3. Run it, then open the App and point it at 127.0.0.1:50053.

The App

ProntoGUI ships with a native rendering App built on Flutter. Think of it as a browser for ProntoGUI servers — your Go program emits primitives over gRPC, the App draws them.

  • Installers for macOS, Windows (Intel, Apple Silicon, ARM)
  • Fast launch, compact binary
  • Regularly updated — security and bug fixes handled by us

Get the App at ProntoGUI Early Access Request

Features

  • 20+ primitives: Text, Command, Check, Choice, TextField, NumericField, Table, List, Frame, Group, Card, Image, Icon, Timer, ImportFile, ExportFile, and more
  • 8,000+ built-in icons
  • Flow, pixel-positioning, and box-model layouts
  • International (Unicode) text support
  • Single-client and multi-client server modes
  • gRPC over HTTP/2 wire protocol — secure, efficient, language-agnostic

Documentation

Contributing

See CONTRIBUTING.md. Issues and pull requests welcome.

License

BSD 3-Clause — see LICENSE.


ProntoGUI™ is a trademark of ProntoGUI, LLC

Documentation

Overview

Copyright 2024-2026 ProntoGUI, LLC Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

ProntoGUI™ is a trademark of ProntoGUI, LLC

Index

Constants

This section is empty.

Variables

View Source
var ErrCanceled = errors.New("operation canceled by provided context")

Defined error indicating that the operation was canceled by way of the context provided in the call. This can be returned from WaitOrCancel or AcceptSession functions.

View Source
var ErrInterrupted = errors.New("operation was interrupted by the caller")

Defined error indicating that the operation was interruptred by the caller using the interrupt channel argument.

View Source
var ErrSessionEnded = errors.New("session ended")

Defined error indicating the session ended, typically when a client disconnects. This can be returned from Wait, WaitOrCancel, or Update functions.

Functions

func ConvertAnyToInt added in v0.0.63

func ConvertAnyToInt(value any) (int, error)

func VAA added in v0.0.62

func VAA(rows ...[]Primitive) [][]Primitive

Adapts a Variable Argument list of primitive rows to an array of primitive rows. Can also be used to create an empty array of primtive rows.

Types

type Any1DField added in v0.0.38

type Any1DField struct {
	FieldBase
	// contains filtered or unexported fields
}

func (*Any1DField) EgestValue added in v0.0.38

func (f *Any1DField) EgestValue() any

func (*Any1DField) Get added in v0.0.38

func (f *Any1DField) Get() []Primitive

func (*Any1DField) IngestValue added in v0.0.38

func (f *Any1DField) IngestValue(value any) error

func (*Any1DField) Length added in v0.0.46

func (f *Any1DField) Length() int

Convenience function that returns the length of the array.

func (*Any1DField) PrepareForUpdates added in v0.0.38

func (f *Any1DField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*Any1DField) Set added in v0.0.38

func (f *Any1DField) Set(ary []Primitive)

func (*Any1DField) UnprepareForUpdates added in v0.0.67

func (f *Any1DField) UnprepareForUpdates()

type Any2DField added in v0.0.38

type Any2DField struct {
	FieldBase
	// contains filtered or unexported fields
}

TODO: swap any type with primitive.Interface and update the test accordingly.

func (*Any2DField) EgestValue added in v0.0.38

func (f *Any2DField) EgestValue() any

func (*Any2DField) Get added in v0.0.38

func (f *Any2DField) Get() [][]Primitive

func (*Any2DField) IngestValue added in v0.0.38

func (f *Any2DField) IngestValue(value any) error

func (*Any2DField) Length added in v0.0.46

func (f *Any2DField) Length() int

Convenience function that returns the length of the array in rows.

func (*Any2DField) PrepareForUpdates added in v0.0.38

func (f *Any2DField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*Any2DField) Set added in v0.0.38

func (f *Any2DField) Set(ary [][]Primitive)

func (*Any2DField) UnprepareForUpdates added in v0.0.67

func (f *Any2DField) UnprepareForUpdates()

type AnyField added in v0.0.38

type AnyField struct {
	FieldBase
	// contains filtered or unexported fields
}

func (*AnyField) EgestValue added in v0.0.38

func (f *AnyField) EgestValue() any

func (*AnyField) Get added in v0.0.38

func (f *AnyField) Get() Primitive

func (*AnyField) IngestValue added in v0.0.38

func (f *AnyField) IngestValue(value any) error

func (*AnyField) PrepareForUpdates added in v0.0.38

func (f *AnyField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*AnyField) Set added in v0.0.38

func (f *AnyField) Set(p Primitive)

func (*AnyField) UnprepareForUpdates added in v0.0.67

func (f *AnyField) UnprepareForUpdates()

type BlobField added in v0.0.38

type BlobField struct {
	FieldBase
	// contains filtered or unexported fields
}

func (*BlobField) EgestValue added in v0.0.38

func (f *BlobField) EgestValue() any

func (*BlobField) Get added in v0.0.38

func (f *BlobField) Get() []byte

func (*BlobField) IngestValue added in v0.0.38

func (f *BlobField) IngestValue(value any) error

func (*BlobField) LoadFromFile added in v0.0.60

func (f *BlobField) LoadFromFile(filePath string) error

func (*BlobField) PrepareForUpdates added in v0.0.38

func (f *BlobField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*BlobField) SaveToFile added in v0.0.60

func (f *BlobField) SaveToFile(filePath string) error

func (*BlobField) Set added in v0.0.38

func (f *BlobField) Set(blob []byte)

type BooleanField added in v0.0.38

type BooleanField struct {
	FieldBase
	// contains filtered or unexported fields
}

func (*BooleanField) EgestValue added in v0.0.38

func (f *BooleanField) EgestValue() any

func (*BooleanField) Get added in v0.0.38

func (f *BooleanField) Get() bool

func (*BooleanField) IngestValue added in v0.0.38

func (f *BooleanField) IngestValue(value any) error

func (*BooleanField) PrepareForUpdates added in v0.0.38

func (f *BooleanField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*BooleanField) Set added in v0.0.38

func (f *BooleanField) Set(b bool)

type Card added in v0.0.56

type Card struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A card displays a main item with optional leading, trailing, and sub item. It is often used to display a summary of a record such as a contact, a product, or a transaction.

func NewCard added in v0.0.56

func NewCard(mainItem Primitive) *Card

Creates a new Card and assigns the main item.

func (*Card) Collapsed added in v0.0.68

func (card *Card) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Card) Embodiment added in v0.0.56

func (card *Card) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Card) Enabled added in v0.0.68

func (card *Card) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Card) LeadingItem added in v0.0.56

func (card *Card) LeadingItem() Primitive

Returns the leading item for this card.

func (*Card) LocateNextDescendant added in v0.0.56

func (card *Card) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*Card) MainItem added in v0.0.56

func (card *Card) MainItem() Primitive

Returns the main item for this card.

func (*Card) PrepareForUpdates added in v0.0.56

func (card *Card) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Card) SetCollapsed added in v0.0.68

func (card *Card) SetCollapsed(collapsed bool) *Card

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Card) SetEmbodiment added in v0.0.56

func (card *Card) SetEmbodiment(s string) *Card

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Card) SetEnabled added in v0.0.68

func (card *Card) SetEnabled(enabled bool) *Card

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Card) SetLeadingItem added in v0.0.56

func (card *Card) SetLeadingItem(p Primitive) *Card

Sets the leading item for this card.

func (*Card) SetMainItem added in v0.0.56

func (card *Card) SetMainItem(p Primitive) *Card

Sets the main item for this card.

func (*Card) SetStatus added in v0.0.68

func (card *Card) SetStatus(i int) *Card

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Card) SetSubItem added in v0.0.56

func (card *Card) SetSubItem(p Primitive) *Card

Sets the sub item for this card.

func (*Card) SetTag added in v0.0.56

func (card *Card) SetTag(s string) *Card

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Checks as Table cells.

func (*Card) SetTrailingItem added in v0.0.56

func (card *Card) SetTrailingItem(p Primitive) *Card

Sets the trailing item for this card.

func (*Card) SetVisible added in v0.0.68

func (card *Card) SetVisible(visible bool) *Card

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Card) Status added in v0.0.68

func (card *Card) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Card) String added in v0.0.56

func (card *Card) String() string

Returns a string representation of this primitive: the mainItem. Implements of fmt:Stringer interface.

func (*Card) SubItem added in v0.0.56

func (card *Card) SubItem() Primitive

Returns the sub item for this card.

func (*Card) Tag added in v0.0.56

func (card *Card) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Checks as Table cells.

func (*Card) TrailingItem added in v0.0.56

func (card *Card) TrailingItem() Primitive

Returns the trailing item for this card.

func (*Card) Visible added in v0.0.68

func (card *Card) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type CardWith added in v0.0.56

type CardWith struct {
	Embodiment   string
	LeadingItem  Primitive
	MainItem     Primitive
	SubItem      Primitive
	Status       int
	Tag          string
	TrailingItem Primitive
}

A card displays a main item with optional leading, trailing, and sub item. It is often used to display a summary of a record such as a contact, a product, or a transaction.

func (CardWith) Make added in v0.0.56

func (w CardWith) Make() *Card

Makes a new Card with specified field values.

type Check added in v0.0.16

type Check struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A check provides a yes/no, on/off, 1/0, kind of choice to the user. It is often represented with a check box like you would see on a form.

func NewCheck added in v0.0.40

func NewCheck(label string) *Check

Creates a new Check and assigns a label.

func (*Check) Checked added in v0.0.16

func (check *Check) Checked() bool

Returns true if the check state is Yes, On, 1, etc., and false if the check state is No, Off, 0, etc.

func (*Check) Collapsed added in v0.0.68

func (p *Check) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Check) Embodiment added in v0.0.27

func (check *Check) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Check) Enabled added in v0.0.68

func (p *Check) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Check) Label added in v0.0.16

func (check *Check) Label() string

Returns the label to display in the check.

func (*Check) LabelItem added in v0.0.63

func (check *Check) LabelItem() Primitive

Returns the label to display in the command.

func (*Check) LocateNextDescendant added in v0.0.63

func (check *Check) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*Check) PrepareForUpdates added in v0.0.16

func (check *Check) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Check) SetChecked added in v0.0.16

func (check *Check) SetChecked(b bool) *Check

Sets the check state.

func (*Check) SetCollapsed added in v0.0.68

func (p *Check) SetCollapsed(collapsed bool) *Check

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Check) SetEmbodiment added in v0.0.27

func (check *Check) SetEmbodiment(s string) *Check

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Check) SetEnabled added in v0.0.68

func (p *Check) SetEnabled(enabled bool) *Check

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Check) SetLabel added in v0.0.16

func (check *Check) SetLabel(s string) *Check

Sets the label to display in the check.

func (*Check) SetLabelItem added in v0.0.63

func (check *Check) SetLabelItem(item Primitive) *Check

Sets the label to display in the command.

func (*Check) SetStatus added in v0.0.68

func (p *Check) SetStatus(i int) *Check

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Check) SetTag added in v0.0.41

func (check *Check) SetTag(s string) *Check

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Checks as Table cells.

func (*Check) SetVisible added in v0.0.68

func (p *Check) SetVisible(visible bool) *Check

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Check) Status added in v0.0.68

func (p *Check) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Check) String added in v0.0.40

func (check *Check) String() string

Returns a string representation of this primitive: the label. Implements of fmt:Stringer interface.

func (*Check) Tag added in v0.0.41

func (check *Check) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Checks as Table cells.

func (*Check) Visible added in v0.0.68

func (p *Check) Visible() bool

Returns the visibility of the Check. This is derived from the Status field.

type CheckWith added in v0.0.17

type CheckWith struct {
	Checked    bool
	Embodiment string
	Label      string
	LabelItem  Primitive
	Status     int
	Tag        string
}

A check provides a yes/no, on/off, 1/0, kind of choice to the user. It is often represented with a check box like you would see on a form.

func (CheckWith) Make added in v0.0.17

func (w CheckWith) Make() *Check

Makes a new Check with specified field values.

type Choice added in v0.0.16

type Choice struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A choice is a user selection from a set of choices. It is often represented using a pull-down list.

func NewChoice added in v0.0.40

func NewChoice(choices ...string) *Choice

Creates a new Choice and assigns the initial Choice and Choices fields.

func (*Choice) Choice added in v0.0.16

func (choice *Choice) Choice() string

Returns the selected choice or empty if none chosen.

func (*Choice) ChoiceIndex added in v0.0.49

func (choice *Choice) ChoiceIndex() int

Returns the index (0, 1, ..) of selected choice or -1 if choice is empty. This is a convenience function as an alternative to Choice(). The canonical storage of choice remains a string.

func (*Choice) ChoiceLabels added in v0.0.56

func (choice *Choice) ChoiceLabels() []string

Returns the labels associated with the choices.

func (*Choice) Choices added in v0.0.16

func (choice *Choice) Choices() []string

Returns the set of valid choices to choose from.

func (*Choice) Collapsed added in v0.0.68

func (p *Choice) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Choice) Embodiment added in v0.0.27

func (choice *Choice) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Choice) Enabled added in v0.0.68

func (p *Choice) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Choice) PrepareForUpdates added in v0.0.16

func (choice *Choice) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Choice) SetChoice added in v0.0.16

func (choice *Choice) SetChoice(s string) *Choice

Sets the selected choice or empty if none chosen.

func (*Choice) SetChoiceIndex added in v0.0.49

func (choice *Choice) SetChoiceIndex(index int) *Choice

Sets the selected choice or empty if none chosen or if index is out of range. This is a convenience function as an alternative to SetChoice(). The canonical storage of choice remains a string.

func (*Choice) SetChoiceLabels added in v0.0.56

func (choice *Choice) SetChoiceLabels(sa []string) *Choice

Sets the optional labels to display for each choice.

func (*Choice) SetChoiceLabelsVA added in v0.0.56

func (choice *Choice) SetChoiceLabelsVA(sa ...string) *Choice

Set the ChoiceLabels field using variadic string arguments.

func (*Choice) SetChoices added in v0.0.16

func (choice *Choice) SetChoices(sa []string) *Choice

Sets the set of valid choices to choose from.

func (*Choice) SetChoicesVA added in v0.0.16

func (choice *Choice) SetChoicesVA(sa ...string) *Choice

Set the Choices field using variadic string arguments.

func (*Choice) SetCollapsed added in v0.0.68

func (p *Choice) SetCollapsed(collapsed bool) *Choice

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Choice) SetEmbodiment added in v0.0.27

func (choice *Choice) SetEmbodiment(s string) *Choice

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Choice) SetEnabled added in v0.0.68

func (p *Choice) SetEnabled(enabled bool) *Choice

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Choice) SetStatus added in v0.0.68

func (p *Choice) SetStatus(i int) *Choice

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Choice) SetTag added in v0.0.41

func (choice *Choice) SetTag(s string) *Choice

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Choices as Table cells.

func (*Choice) SetVisible added in v0.0.68

func (p *Choice) SetVisible(visible bool) *Choice

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Choice) Status added in v0.0.68

func (p *Choice) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Choice) String added in v0.0.40

func (choice *Choice) String() string

Returns a string representation of this primitive: the current choice. Implements of fmt:Stringer interface.

func (*Choice) Tag added in v0.0.41

func (choice *Choice) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Choices as Table cells.

func (*Choice) Visible added in v0.0.68

func (p *Choice) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type ChoiceWith added in v0.0.17

type ChoiceWith struct {
	Choice       string
	Choices      []string
	ChoiceLabels []string
	Embodiment   string
	Status       int
	Tag          string
}

A choice is a user selection from a set of choices. It is often represented using a pull-down list.

func (ChoiceWith) Make added in v0.0.17

func (w ChoiceWith) Make() *Choice

Makes a new Choice with specified field values.

type Command added in v0.0.10

type Command struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A command is used to handle momentary requests by the user such that, when the command is issued, the service does something useful. It is often rendered as a button with clear boundaries that suggest it can be clicked.

func NewCommand added in v0.0.40

func NewCommand(label string) *Command

Creates a new command and assigns a label.

func (*Command) Collapsed added in v0.0.68

func (p *Command) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Command) Embodiment added in v0.0.27

func (cmd *Command) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Command) Enabled added in v0.0.40

func (p *Command) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Command) Issued added in v0.0.10

func (cmd *Command) Issued() bool

Returns true if the command was issued during the current Wait cycle.

func (*Command) Label added in v0.0.10

func (cmd *Command) Label() string

Returns the label to display in the command.

func (*Command) LabelItem added in v0.0.63

func (cmd *Command) LabelItem() Primitive

Returns the label to display in the command.

func (*Command) LocateNextDescendant added in v0.0.63

func (cmd *Command) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*Command) PrepareForUpdates added in v0.0.10

func (cmd *Command) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Command) SetCollapsed added in v0.0.68

func (p *Command) SetCollapsed(collapsed bool) *Command

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Command) SetEmbodiment added in v0.0.27

func (cmd *Command) SetEmbodiment(s string) *Command

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Command) SetEnabled added in v0.0.40

func (p *Command) SetEnabled(enabled bool) *Command

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Command) SetLabel added in v0.0.11

func (cmd *Command) SetLabel(s string) *Command

Sets the label to display in the command.

func (*Command) SetLabelItem added in v0.0.63

func (cmd *Command) SetLabelItem(item Primitive) *Command

Sets the label to display in the command.

func (*Command) SetStatus added in v0.0.11

func (p *Command) SetStatus(i int) *Command

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Command) SetTag added in v0.0.40

func (cmd *Command) SetTag(s string) *Command

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Commands as Table cells.

func (*Command) SetVisible added in v0.0.40

func (p *Command) SetVisible(visible bool) *Command

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Command) Status added in v0.0.10

func (p *Command) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Command) String added in v0.0.40

func (cmd *Command) String() string

Returns a string representation of this primitive: the label. Implements of fmt:Stringer interface.

func (*Command) Tag added in v0.0.40

func (cmd *Command) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Commands as Table cells.

func (*Command) Visible added in v0.0.40

func (p *Command) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type CommandWith added in v0.0.17

type CommandWith struct {
	Embodiment string
	Label      string
	LabelItem  Primitive
	Status     int
	Tag        string
}

A command is used to handle momentary requests by the user such that, when the command is issued, the service does something useful. It is often rendered as a button with clear boundaries that suggest it can be clicked.

func (CommandWith) Make added in v0.0.17

func (w CommandWith) Make() *Command

Makes a new Command with specified field values.

type EventField added in v0.0.42

type EventField struct {
	FieldBase
	// contains filtered or unexported fields
}

The EventField is used to capture an event condition happening on the App side. For example, when the user clicks on a Command, we need to know on the server side the moment this happens during a Wait cycle.

Unlike other field types, this field doesn't store a value per se, but tracks if a value has been injested during the current Wait cycle. This information is only valid if the Issued() method is called during the current Wait cycle. If another Wait cycle is entered and no value is injested by this field, then it will no longer report Issued() = true.

The field type solved a nagging problem when dealing with handling events on the service side, especially when Command primitivess are clicked/issued. The Command doesn't have any state that changes like a Check or TextField might have, and the information it produces is momentary in nature.

This field requires initialization after creation by setting its TimestampProvider member. The timestamp provider supplies a time value that originates from the time package and uniquely represents the current Wait cycle. A good implementation will keep a central timestamp generated from time.Now(), called at the beginning of each Wait cycle, and a central function for returning the timestamp. The central function is assigned to every EventField during construction.

We avoided creating a global timestamp in this module because in the future there could be multiple, concurrent Wait cycles going on. It is also fragile to write unit tests this way.

func (*EventField) EgestValue added in v0.0.42

func (f *EventField) EgestValue() any

func (*EventField) IngestValue added in v0.0.42

func (f *EventField) IngestValue(value any) error

func (*EventField) Issued added in v0.0.42

func (f *EventField) Issued() bool

Returns true if the event was assigned during the current Wait cycle, as determined from the timestamp provider.

func (*EventField) PrepareForUpdates added in v0.0.42

func (f *EventField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

type EventTimestampProvider added in v1.0.0

type EventTimestampProvider func() time.Time

type ExportFile added in v0.0.34

type ExportFile struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A file represents a blob of data that can be exported from the server side and stored to a file on the app side. The perspective of "export" is centered around the server software. This seems to be a little clearer than using Download/Upload terminology.

func NewExportFile added in v0.0.40

func NewExportFile() *ExportFile

Creates a new ExportFile.

func (*ExportFile) Collapsed added in v0.0.68

func (p *ExportFile) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*ExportFile) Data added in v0.0.34

func (ef *ExportFile) Data() []byte

Returns the blob of data representing the binary contents of the file. Note: this data could be empty and yet represent a valid, albeit empty, file for export.

func (*ExportFile) Embodiment added in v0.0.34

func (ef *ExportFile) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*ExportFile) Enabled added in v0.0.68

func (p *ExportFile) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*ExportFile) Exported added in v0.0.34

func (ef *ExportFile) Exported() bool

Returns true when the file has been exported (stored to a file) by the app. This field is normally only updated by the app.

func (*ExportFile) Name added in v0.0.34

func (ef *ExportFile) Name() string

Returns the suggested file name (including its extension separated by a period) to save the file as.

func (*ExportFile) PrepareForUpdates added in v0.0.34

func (ef *ExportFile) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*ExportFile) Reset added in v0.0.49

func (ef *ExportFile) Reset()

Clears the exported data and the exported flag.

func (*ExportFile) SetCollapsed added in v0.0.68

func (p *ExportFile) SetCollapsed(collapsed bool) *ExportFile

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*ExportFile) SetData added in v0.0.34

func (ef *ExportFile) SetData(d []byte) *ExportFile

Sets the blob of data representing the binary contents of the file to export.

func (*ExportFile) SetEmbodiment added in v0.0.34

func (ef *ExportFile) SetEmbodiment(s string) *ExportFile

Sets a JSON string specifying the embodiment to use for this primitive.

func (*ExportFile) SetEnabled added in v0.0.68

func (p *ExportFile) SetEnabled(enabled bool) *ExportFile

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*ExportFile) SetExported added in v0.0.34

func (ef *ExportFile) SetExported(b bool) *ExportFile

Sets whether or not the file has been exported (stored to a file) by the app. This field is normally only updated by the app.

func (*ExportFile) SetName added in v0.0.34

func (ef *ExportFile) SetName(s string) *ExportFile

Sets the suggested file name (including its extension separated by a period) to save the file as.

func (*ExportFile) SetStatus added in v0.0.68

func (p *ExportFile) SetStatus(i int) *ExportFile

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*ExportFile) SetTag added in v0.0.41

func (ef *ExportFile) SetTag(s string) *ExportFile

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using ExportFiles as Table cells.

func (*ExportFile) SetVisible added in v0.0.68

func (p *ExportFile) SetVisible(visible bool) *ExportFile

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*ExportFile) Status added in v0.0.68

func (p *ExportFile) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*ExportFile) Tag added in v0.0.41

func (ef *ExportFile) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using ExportFiles as Table cells.

func (*ExportFile) Visible added in v0.0.68

func (p *ExportFile) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type ExportFileWith added in v0.0.34

type ExportFileWith struct {
	Data       []byte
	Embodiment string
	Name       string
	Status     int
	Tag        string
}

A file represents a blob of data that can be exported from the server side and stored to a file on the app side. The perspective of "export" is centered around the server software. This seems to be a little clearer than using Download/Upload terminology.

func (ExportFileWith) Make added in v0.0.34

func (w ExportFileWith) Make() *ExportFile

Makes a new Command with specified field values.

type Field added in v0.0.38

type Field interface {
	PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isStructural bool)
	UnprepareForUpdates()
	EgestValue() any
	IngestValue(value any) error
}

type FieldBase added in v0.0.38

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

func (*FieldBase) ClearUpdateInfo added in v0.0.67

func (f *FieldBase) ClearUpdateInfo()

func (*FieldBase) OnSet added in v0.0.38

func (f *FieldBase) OnSet(structural bool)

func (*FieldBase) StashUpdateInfo added in v0.0.38

func (f *FieldBase) StashUpdateInfo(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider)

func (*FieldBase) UnprepareForUpdates added in v0.0.67

func (f *FieldBase) UnprepareForUpdates()

type FieldRef added in v0.0.11

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

type Folder added in v1.0.0

type Folder struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A folder represents a container in a hierarchical list structure. It contains a label item (any primitive) and a level indicating its depth in the hierarchy. The Expanded field controls whether items logically "inside" this folder are shown.

func NewFolder added in v1.0.0

func NewFolder(labelItem Primitive, level int) *Folder

Creates a new Folder at a specified level and assigns the label item.

func (*Folder) Collapsed added in v1.0.0

func (p *Folder) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Folder) Embodiment added in v1.0.0

func (folder *Folder) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Folder) Enabled added in v1.0.0

func (p *Folder) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Folder) Expanded added in v1.0.0

func (folder *Folder) Expanded() bool

Returns true if the folder is expanded.

func (*Folder) LabelItem added in v1.0.0

func (folder *Folder) LabelItem() Primitive

Returns the label item for this folder.

func (*Folder) Level added in v1.0.0

func (folder *Folder) Level() int

Returns the hierarchical level of this folder.

func (*Folder) LocateNextDescendant added in v1.0.0

func (folder *Folder) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*Folder) PrepareForUpdates added in v1.0.0

func (folder *Folder) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Folder) SetCollapsed added in v1.0.0

func (p *Folder) SetCollapsed(collapsed bool) *Folder

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Folder) SetEmbodiment added in v1.0.0

func (folder *Folder) SetEmbodiment(s string) *Folder

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Folder) SetEnabled added in v1.0.0

func (p *Folder) SetEnabled(enabled bool) *Folder

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Folder) SetExpanded added in v1.0.0

func (folder *Folder) SetExpanded(b bool) *Folder

Sets whether the folder is expanded.

func (*Folder) SetLabelItem added in v1.0.0

func (folder *Folder) SetLabelItem(p Primitive) *Folder

Sets the label item for this folder.

func (*Folder) SetLevel added in v1.0.0

func (folder *Folder) SetLevel(level int) *Folder

Sets the hierarchical level of this folder.

func (*Folder) SetStatus added in v1.0.0

func (p *Folder) SetStatus(i int) *Folder

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Folder) SetTag added in v1.0.0

func (folder *Folder) SetTag(s string) *Folder

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Folders inside other containers.

func (*Folder) SetVisible added in v1.0.0

func (p *Folder) SetVisible(visible bool) *Folder

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Folder) Status added in v1.0.0

func (p *Folder) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Folder) String added in v1.0.0

func (folder *Folder) String() string

Returns a string representation of this primitive. Implements of fmt:Stringer interface.

func (*Folder) Tag added in v1.0.0

func (folder *Folder) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Folders inside other containers.

func (*Folder) Visible added in v1.0.0

func (p *Folder) Visible() bool

Returns the visibility of the folder. This is derived from the Status field.

type FolderItem added in v1.0.0

type FolderItem struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A folder item represents an item in a hierarchical list structure. It contains an item (any primitive) and a level indicating its depth in the hierarchy.

func NewFolderItem added in v1.0.0

func NewFolderItem(item Primitive, level int) *FolderItem

Creates a new FolderItem at a specified level and assigns the item.

func (*FolderItem) Collapsed added in v1.0.0

func (p *FolderItem) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*FolderItem) Embodiment added in v1.0.0

func (folderItem *FolderItem) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*FolderItem) Enabled added in v1.0.0

func (p *FolderItem) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*FolderItem) Item added in v1.0.0

func (folderItem *FolderItem) Item() Primitive

Returns the item for this folder item.

func (*FolderItem) Level added in v1.0.0

func (folderItem *FolderItem) Level() int

Returns the hierarchical level of this folder item.

func (*FolderItem) LocateNextDescendant added in v1.0.0

func (folderItem *FolderItem) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*FolderItem) PrepareForUpdates added in v1.0.0

func (folderItem *FolderItem) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*FolderItem) SetCollapsed added in v1.0.0

func (p *FolderItem) SetCollapsed(collapsed bool) *FolderItem

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*FolderItem) SetEmbodiment added in v1.0.0

func (folderItem *FolderItem) SetEmbodiment(s string) *FolderItem

Sets a JSON string specifying the embodiment to use for this primitive.

func (*FolderItem) SetEnabled added in v1.0.0

func (p *FolderItem) SetEnabled(enabled bool) *FolderItem

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*FolderItem) SetItem added in v1.0.0

func (folderItem *FolderItem) SetItem(p Primitive) *FolderItem

Sets the item for this folder item.

func (*FolderItem) SetLevel added in v1.0.0

func (folderItem *FolderItem) SetLevel(level int) *FolderItem

Sets the hierarchical level of this folder item.

func (*FolderItem) SetStatus added in v1.0.0

func (p *FolderItem) SetStatus(i int) *FolderItem

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*FolderItem) SetTag added in v1.0.0

func (folderItem *FolderItem) SetTag(s string) *FolderItem

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using FolderItems inside other containers.

func (*FolderItem) SetVisible added in v1.0.0

func (p *FolderItem) SetVisible(visible bool) *FolderItem

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*FolderItem) Status added in v1.0.0

func (p *FolderItem) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*FolderItem) String added in v1.0.0

func (folderItem *FolderItem) String() string

Returns a string representation of this primitive. Implements of fmt:Stringer interface.

func (*FolderItem) Tag added in v1.0.0

func (folderItem *FolderItem) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using FolderItems inside other containers.

func (*FolderItem) Visible added in v1.0.0

func (p *FolderItem) Visible() bool

Returns the visibility of the folder item. This is derived from the Status field.

type FolderItemWith added in v1.0.0

type FolderItemWith struct {
	Embodiment string
	Item       Primitive
	Level      int
	Status     int
	Tag        string
}

A folder item represents an item in a hierarchical list structure. It contains an item (any primitive) and a level indicating its depth in the hierarchy.

func (FolderItemWith) Make added in v1.0.0

func (w FolderItemWith) Make() *FolderItem

Makes a new FolderItem with specified field values.

type FolderWith added in v1.0.0

type FolderWith struct {
	Embodiment string
	Expanded   bool
	LabelItem  Primitive
	Level      int
	Status     int
	Tag        string
}

A folder represents a container in a hierarchical list structure. It contains a label item (any primitive) and a level indicating its depth in the hierarchy. The Expanded field controls whether items logically "inside" this folder are shown.

func (FolderWith) Make added in v1.0.0

func (w FolderWith) Make() *Folder

Makes a new Folder with specified field values.

type Frame added in v0.0.29

type Frame struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A frame represents a complete user interface to show on the screen. It could be the main user interface or a sub-screen in the app. It includes the ability to layout controls in a specific manner.

func NewFrame added in v0.0.40

func NewFrame(items ...Primitive) *Frame

Creates a new Frame and assigns a set of items.

func (*Frame) Collapsed added in v0.0.68

func (p *Frame) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Frame) Embodiment added in v0.0.40

func (frame *Frame) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Frame) Enabled added in v0.0.68

func (p *Frame) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Frame) FrameItems added in v0.0.29

func (frame *Frame) FrameItems() []Primitive

Returns the collection of primitives that comprise the GUI frame.

func (*Frame) Icon added in v0.0.56

func (frame *Frame) Icon() Primitive

Returns the optional icon item for this frame.

func (*Frame) LocateNextDescendant added in v0.0.30

func (frame *Frame) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*Frame) PrepareForUpdates added in v0.0.29

func (frame *Frame) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Frame) SetCollapsed added in v0.0.68

func (p *Frame) SetCollapsed(collapsed bool) *Frame

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Frame) SetEmbodiment added in v0.0.40

func (frame *Frame) SetEmbodiment(s string) *Frame

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Frame) SetEnabled added in v0.0.68

func (p *Frame) SetEnabled(enabled bool) *Frame

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Frame) SetFrameItems added in v0.0.29

func (frame *Frame) SetFrameItems(items []Primitive) *Frame

Sets the collection of primitives that comprise the GUI frame.

func (*Frame) SetFrameItemsVA added in v0.0.29

func (frame *Frame) SetFrameItemsVA(items ...Primitive) *Frame

Sets the collection of primitives (variadic argument list) that comprise the GUI frame.

func (*Frame) SetIcon added in v0.0.56

func (frame *Frame) SetIcon(p Primitive) *Frame

Sets the optional icon for this frame.

func (*Frame) SetShowing added in v0.0.33

func (frame *Frame) SetShowing(showing bool) *Frame

Sets whether the Frame is being shown on the screen.

func (*Frame) SetStatus added in v0.0.68

func (p *Frame) SetStatus(i int) *Frame

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Frame) SetTag added in v0.0.41

func (frame *Frame) SetTag(s string) *Frame

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Frames inside other containers.

func (*Frame) SetTitle added in v0.0.56

func (frame *Frame) SetTitle(s string) *Frame

Sets the title of the frame.

func (*Frame) SetVisible added in v0.0.68

func (p *Frame) SetVisible(visible bool) *Frame

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Frame) Showing added in v0.0.33

func (frame *Frame) Showing() bool

Returns whether the Frame is being shown on the screen.

func (*Frame) Status added in v0.0.68

func (p *Frame) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Frame) Tag added in v0.0.41

func (frame *Frame) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Frames inside other containers.

func (*Frame) Title added in v0.0.56

func (frame *Frame) Title() string

Returns the title of the frame.

func (*Frame) Visible added in v0.0.68

func (p *Frame) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type FrameWith added in v0.0.29

type FrameWith struct {
	Embodiment string
	FrameItems []Primitive
	Icon       Primitive
	Showing    bool
	Status     int
	Tag        string
	Title      string
}

A frame represents a complete user interface to show on the screen. It could be the main user interface or a sub-screen in the app. It includes the ability to layout controls in a specific manner.

func (FrameWith) Make added in v0.0.29

func (w FrameWith) Make() *Frame

Creates a new Frame using the supplied field assignments.

type Group added in v0.0.16

type Group struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A group is a related set of primitives, such as a group of commands, that is static in type and quantity. If a dynamic number of primitives is desired then consider using a List primitive instead.

func NewGroup added in v0.0.40

func NewGroup(items ...Primitive) *Group

Creates a new Group and assigns items.

func (*Group) Collapsed added in v0.0.68

func (p *Group) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Group) Embodiment added in v0.0.27

func (grp *Group) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Group) Enabled added in v0.0.56

func (p *Group) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Group) GroupItems added in v0.0.16

func (grp *Group) GroupItems() []Primitive

Returns the collection of primitives that make up the group.

func (*Group) LocateNextDescendant added in v0.0.27

func (grp *Group) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*Group) PrepareForUpdates added in v0.0.16

func (grp *Group) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Group) SetCollapsed added in v0.0.68

func (p *Group) SetCollapsed(collapsed bool) *Group

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Group) SetEmbodiment added in v0.0.27

func (grp *Group) SetEmbodiment(s string) *Group

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Group) SetEnabled added in v0.0.56

func (p *Group) SetEnabled(enabled bool) *Group

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Group) SetGroupItems added in v0.0.16

func (grp *Group) SetGroupItems(items []Primitive) *Group

Sets the collection of primitives that make up the group.

func (*Group) SetGroupItemsVA added in v0.0.16

func (grp *Group) SetGroupItemsVA(items ...Primitive) *Group

Sets the collection of primitives (a variadic argument list) that make up the group.

func (*Group) SetStatus added in v0.0.56

func (p *Group) SetStatus(i int) *Group

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Group) SetTag added in v0.0.41

func (grp *Group) SetTag(s string) *Group

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Groups inside other containers.

func (*Group) SetVisible added in v0.0.56

func (p *Group) SetVisible(visible bool) *Group

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Group) Status added in v0.0.56

func (p *Group) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Group) Tag added in v0.0.41

func (grp *Group) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Groups inside other containers.

func (*Group) Visible added in v0.0.56

func (p *Group) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type GroupWith added in v0.0.17

type GroupWith struct {
	Embodiment string
	GroupItems []Primitive
	Status     int
	Tag        string
}

A group is a related set of primitives, such as a group of commands, that is static in type and quantity. If a dynamic number of primitives is desired then consider using a List primitive instead.

func (GroupWith) Make added in v0.0.17

func (w GroupWith) Make() *Group

Creates a new Group using the supplied field assignments.

type Icon added in v0.0.56

type Icon struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

An icon primitive displays a material icon on the screen.

func NewIcon added in v0.0.56

func NewIcon(iconID string) *Icon

Create a new Icon and assign its content.

func (*Icon) Collapsed added in v0.0.68

func (p *Icon) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Icon) Embodiment added in v0.0.56

func (icon *Icon) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Icon) Enabled added in v0.0.68

func (p *Icon) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Icon) IconID added in v0.0.56

func (icon *Icon) IconID() string

Returns the icon ID.

func (*Icon) PrepareForUpdates added in v0.0.56

func (icon *Icon) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Icon) SetCollapsed added in v0.0.68

func (p *Icon) SetCollapsed(collapsed bool) *Icon

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Icon) SetEmbodiment added in v0.0.56

func (icon *Icon) SetEmbodiment(s string) *Icon

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Icon) SetEnabled added in v0.0.68

func (p *Icon) SetEnabled(enabled bool) *Icon

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Icon) SetIconID added in v0.0.56

func (icon *Icon) SetIconID(s string) *Icon

Sets the icon ID.

func (*Icon) SetStatus added in v0.0.68

func (p *Icon) SetStatus(i int) *Icon

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Icon) SetTag added in v0.0.56

func (icon *Icon) SetTag(s string) *Icon

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Texts as Table cells.

func (*Icon) SetVisible added in v0.0.68

func (p *Icon) SetVisible(visible bool) *Icon

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Icon) Status added in v0.0.68

func (p *Icon) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Icon) String added in v0.0.56

func (icon *Icon) String() string

Returns a string representation of this primitive: the iconID. Implements of fmt:Stringer interface.

func (*Icon) Tag added in v0.0.56

func (icon *Icon) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Texts as Table cells.

func (*Icon) Visible added in v0.0.68

func (p *Icon) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type IconWith added in v0.0.56

type IconWith struct {
	IconID     string
	Embodiment string
	Status     int
	Tag        string
}

An icon primitive displays a material icon on the screen.

func (IconWith) Make added in v0.0.56

func (w IconWith) Make() *Icon

Creates a new Icon primitive using the supplied field assignments.

type Image added in v0.0.38

type Image struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

An image for displaying a graphic to display on the screen.

func NewImage added in v0.0.40

func NewImage(fromFile string) (*Image, error)

Creates a new Image from a file.

func (*Image) Collapsed added in v0.0.68

func (p *Image) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Image) Embodiment added in v0.0.38

func (image *Image) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Image) Enabled added in v0.0.68

func (p *Image) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Image) ID added in v0.0.60

func (image *Image) ID() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Image) Image added in v0.0.38

func (image *Image) Image() []byte

Returns the binary data for the image

func (*Image) LoadFromFile added in v0.0.60

func (image *Image) LoadFromFile(filename string) error

func (*Image) PrepareForUpdates added in v0.0.38

func (image *Image) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Image) Ref added in v0.0.60

func (image *Image) Ref() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Image) SaveToFile added in v0.0.60

func (image *Image) SaveToFile(filename string) error

func (*Image) SetCollapsed added in v0.0.68

func (p *Image) SetCollapsed(collapsed bool) *Image

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Image) SetEmbodiment added in v0.0.38

func (image *Image) SetEmbodiment(s string) *Image

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Image) SetEnabled added in v0.0.68

func (p *Image) SetEnabled(enabled bool) *Image

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Image) SetID added in v0.0.60

func (image *Image) SetID(s string) *Image

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Image) SetImage added in v0.0.38

func (image *Image) SetImage(data []byte) *Image

Sets the binary data for the image

func (*Image) SetRef added in v0.0.60

func (image *Image) SetRef(s string) *Image

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Image) SetStatus added in v0.0.68

func (p *Image) SetStatus(i int) *Image

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Image) SetTag added in v0.0.41

func (image *Image) SetTag(s string) *Image

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Commands as Table cells.

func (*Image) SetVisible added in v0.0.68

func (p *Image) SetVisible(visible bool) *Image

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Image) Status added in v0.0.68

func (p *Image) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Image) Tag added in v0.0.41

func (image *Image) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Commands as Table cells.

func (*Image) Visible added in v0.0.68

func (p *Image) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type ImageWith added in v0.0.38

type ImageWith struct {
	// Embodiment specification
	Embodiment string

	// Binary data representing the image.  Supported formats are: JPEG, PNG, GIF, Animated GIF, WebP, Animated WebP, BMP, and WBMP
	Image []byte

	// The file path containing an image.  If specified, this takes precedence over Image field.
	// Supported file types are: JPEG, PNG, GIF, Animated GIF, WebP, Animated WebP, BMP, and WBMP
	FromFile string

	// Arbitraty tag string for the primitive
	Tag string

	// ID for this primitive. Used when referencing it from another primitive. This can be arbitrary but
	// it should ideally be a unique string.  Otherwise, when two primitives have the same ID, there is no
	// guarantee on which is referenced.
	ID string

	// Reference (ID) of another image primitive that contains the actual image data to display.  This allows
	// a way to use the same image in multiple places in a more efficient manner.
	Ref string

	Status int
}

An image for displaying a graphic to display on the screen.

func (ImageWith) Make added in v0.0.38

func (w ImageWith) Make() (*Image, error)

Makes a new Image with specified field values.

type ImportFile added in v0.0.34

type ImportFile struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A file that represents a blob of data that can be imported from the app side and consumed on the server side.

func NewImportFile added in v0.0.40

func NewImportFile() *ImportFile

Creates a new ImportFile.

func (*ImportFile) Collapsed added in v0.0.68

func (p *ImportFile) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*ImportFile) Data added in v0.0.34

func (ifile *ImportFile) Data() []byte

Returns the blob of data for the file. Note: this data could be empty and yet represent a valid imported, albeit empty, file. Therefore, it is important to look at Imported() field to know whether data has been imported. Conversely, if the Imported() function returns false then this will return an empty array.

func (*ImportFile) Embodiment added in v0.0.34

func (ifile *ImportFile) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*ImportFile) Enabled added in v0.0.68

func (p *ImportFile) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*ImportFile) ImportData added in v0.0.49

func (ifile *ImportFile) ImportData(d []byte) *ImportFile

Sets the blob of data for the file and sets imported flag to true.

func (*ImportFile) Imported added in v0.0.34

func (ifile *ImportFile) Imported() bool

Returns true when the file has been imported by the app side and signals to the server side that file is ready to processs. This field is normally only updated by the app.

func (*ImportFile) Name added in v0.0.34

func (ifile *ImportFile) Name() string

Returns the imported file name including its extension separated by a period.

func (*ImportFile) PrepareForUpdates added in v0.0.34

func (ifile *ImportFile) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*ImportFile) Reset added in v0.0.49

func (ifile *ImportFile) Reset()

Clears the imported data and the imported flag.

func (*ImportFile) SetCollapsed added in v0.0.68

func (p *ImportFile) SetCollapsed(collapsed bool) *ImportFile

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*ImportFile) SetEmbodiment added in v0.0.34

func (ifile *ImportFile) SetEmbodiment(s string) *ImportFile

Sets a JSON string specifying the embodiment to use for this primitive.

func (*ImportFile) SetEnabled added in v0.0.68

func (p *ImportFile) SetEnabled(enabled bool) *ImportFile

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*ImportFile) SetImported added in v0.0.34

func (ifile *ImportFile) SetImported(b bool) *ImportFile

Sets whether the file has been imported by the app side and signals to the server side that file is ready to processs. This field is normally only updated by the app.

func (*ImportFile) SetName added in v0.0.34

func (ifile *ImportFile) SetName(s string) *ImportFile

Sets the imported file name including its extension separated by a period.

func (*ImportFile) SetStatus added in v0.0.68

func (p *ImportFile) SetStatus(i int) *ImportFile

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*ImportFile) SetTag added in v0.0.41

func (ifile *ImportFile) SetTag(s string) *ImportFile

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Commands as Table cells.

func (*ImportFile) SetValidExtensions added in v0.0.34

func (ifile *ImportFile) SetValidExtensions(sa []string) *ImportFile

Sets the valid extensions for importing (non-case sensitive and period separator is omitted).

func (*ImportFile) SetVisible added in v0.0.68

func (p *ImportFile) SetVisible(visible bool) *ImportFile

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*ImportFile) Status added in v0.0.68

func (p *ImportFile) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*ImportFile) Tag added in v0.0.41

func (ifile *ImportFile) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Commands as Table cells.

func (*ImportFile) ValidExtensions added in v0.0.34

func (ifile *ImportFile) ValidExtensions() []string

Returns the valid extensions for importing (non-case sensitive and period separator is omitted).

func (*ImportFile) Visible added in v0.0.68

func (p *ImportFile) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type ImportFileWith added in v0.0.34

type ImportFileWith struct {
	Data            []byte
	Embodiment      string
	Name            string
	Status          int
	Tag             string
	ValidExtensions []string
}

A file that represents a blob of data that can be imported from the app side and consumed on the server side.

func (ImportFileWith) Make added in v0.0.34

func (w ImportFileWith) Make() *ImportFile

Makes a new ImportFile with specified field values.

type Integer1DField added in v0.0.56

type Integer1DField struct {
	FieldBase
	// contains filtered or unexported fields
}

func (*Integer1DField) EgestValue added in v0.0.56

func (f *Integer1DField) EgestValue() any

func (*Integer1DField) Get added in v0.0.56

func (f *Integer1DField) Get() []int

func (*Integer1DField) IngestValue added in v0.0.56

func (f *Integer1DField) IngestValue(value any) error

func (*Integer1DField) PrepareForUpdates added in v0.0.56

func (f *Integer1DField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*Integer1DField) Set added in v0.0.56

func (f *Integer1DField) Set(ia []int)

type IntegerField added in v0.0.38

type IntegerField struct {
	FieldBase
	// contains filtered or unexported fields
}

func (*IntegerField) EgestValue added in v0.0.38

func (f *IntegerField) EgestValue() any

func (*IntegerField) Get added in v0.0.38

func (f *IntegerField) Get() int

func (*IntegerField) IngestValue added in v0.0.38

func (f *IntegerField) IngestValue(value any) error

func (*IntegerField) PrepareForUpdates added in v0.0.38

func (f *IntegerField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*IntegerField) Set added in v0.0.38

func (f *IntegerField) Set(i int)

type List added in v0.0.25

type List struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A list is a collection of primitives that have a sequential-like relationship and might be dynamic in quantity or kind.

func NewList added in v0.0.40

func NewList(items ...Primitive) *List

Creates a new List and assigns items.

func (*List) Collapsed added in v0.0.68

func (p *List) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*List) Embodiment added in v0.0.27

func (list *List) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*List) Enabled added in v0.0.68

func (p *List) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*List) ListItems added in v0.0.25

func (list *List) ListItems() []Primitive

Returns the items to show in the list.

func (*List) LocateNextDescendant added in v0.0.27

func (list *List) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*List) ModelFolder added in v1.0.0

func (list *List) ModelFolder() Primitive

Returns the model folder item.

func (*List) ModelItem added in v0.0.56

func (list *List) ModelItem() Primitive

Returns the model item.

func (*List) PrepareForUpdates added in v0.0.25

func (list *List) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*List) SelectedItems added in v0.0.68

func (list *List) SelectedItems() []int

Returns the currently selected items or empty list for none selected.

func (*List) SelectionMode added in v0.0.68

func (list *List) SelectionMode() int

Returns the status of the table: 0 = None, 1 = One Always Selected, 2 = One or None, 3 = Multiple 4 = Range Atleast One, 5 = Range Any or None at all.

func (*List) SetCollapsed added in v0.0.68

func (p *List) SetCollapsed(collapsed bool) *List

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*List) SetEmbodiment added in v0.0.27

func (list *List) SetEmbodiment(s string) *List

Sets a JSON string specifying the embodiment to use for this primitive.

func (*List) SetEnabled added in v0.0.68

func (p *List) SetEnabled(enabled bool) *List

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*List) SetListItems added in v0.0.25

func (list *List) SetListItems(items []Primitive) *List

Sets the items to show in the list.

func (*List) SetListItemsVA added in v0.0.25

func (list *List) SetListItemsVA(items ...Primitive) *List

Returns the items to show in the list (as a variadic argument list).

func (*List) SetModelFolder added in v1.0.0

func (list *List) SetModelFolder(item Primitive) *List

Sets the model folder item.

func (*List) SetModelItem added in v0.0.56

func (list *List) SetModelItem(item Primitive) *List

Sets the model item.

func (*List) SetSelectedItems added in v0.0.68

func (list *List) SetSelectedItems(selectedItems []int) *List

Sets the currently selected items.

func (*List) SetSelectionMode added in v0.0.68

func (list *List) SetSelectionMode(mode int) *List

Sets the selection mode: 0 = None, 1 = One Always Selected, 2 = One or None, 3 = Multiple 4 = Range Atleast One, 5 = Range Any or None at all.

func (*List) SetStatus added in v0.0.68

func (p *List) SetStatus(i int) *List

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*List) SetTag added in v0.0.41

func (list *List) SetTag(s string) *List

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Lists inside other containers.

func (*List) SetVisible added in v0.0.68

func (p *List) SetVisible(visible bool) *List

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*List) Status added in v0.0.68

func (p *List) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*List) Tag added in v0.0.41

func (list *List) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Lists inside other containers.

func (*List) Visible added in v0.0.68

func (p *List) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type ListWith added in v0.0.25

type ListWith struct {
	Embodiment    string
	ListItems     []Primitive
	ModelFolder   Primitive
	ModelItem     Primitive
	SelectedItems []int
	SelectionMode int
	Status        int
	Tag           string
}

A list is a collection of primitives that have a sequential-like relationship and might be dynamic in quantity or kind.

func (ListWith) Make added in v0.0.25

func (w ListWith) Make() *List

Creates a new List using the supplied field assignments.

type Nothing added in v0.0.56

type Nothing struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
}

A nothing primitive displays nothing on the screen. It can be used as a placeholder.

func NewNothing added in v0.0.56

func NewNothing() *Nothing

Create a new Nothing.

func (*Nothing) PrepareForUpdates added in v0.0.56

func (nothing *Nothing) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Nothing) String added in v0.0.56

func (nothing *Nothing) String() string

Returns a string representation of this primitive. Implements of fmt:Stringer interface.

type NothingWith added in v0.0.56

type NothingWith struct {
}

A nothing primitive displays nothing on the screen. It can be used as a placeholder.

func (NothingWith) Make added in v0.0.56

func (w NothingWith) Make() *Nothing

Creates a new Nothing primitive using the supplied field assignments.

type NumericField added in v0.0.56

type NumericField struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A field for entering numeric values.

func NewNumericField added in v0.0.56

func NewNumericField(numericEntry string) *NumericField

Create a new NumericField and assign its numeric entry field.

func (*NumericField) Collapsed added in v0.0.68

func (p *NumericField) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*NumericField) Embodiment added in v0.0.56

func (nf *NumericField) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*NumericField) Enabled added in v0.0.68

func (p *NumericField) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*NumericField) NumericEntry added in v0.0.56

func (nf *NumericField) NumericEntry() string

Returns the numeric entry value.

func (*NumericField) PrepareForUpdates added in v0.0.56

func (nf *NumericField) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*NumericField) SetCollapsed added in v0.0.68

func (p *NumericField) SetCollapsed(collapsed bool) *NumericField

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*NumericField) SetEmbodiment added in v0.0.56

func (nf *NumericField) SetEmbodiment(s string) *NumericField

Sets a JSON string specifying the embodiment to use for this primitive.

func (*NumericField) SetEnabled added in v0.0.68

func (p *NumericField) SetEnabled(enabled bool) *NumericField

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*NumericField) SetNumericEntry added in v0.0.56

func (nf *NumericField) SetNumericEntry(s string) *NumericField

Sets the the numeric entry value.

func (*NumericField) SetStatus added in v0.0.68

func (p *NumericField) SetStatus(i int) *NumericField

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*NumericField) SetTag added in v0.0.56

func (nf *NumericField) SetTag(s string) *NumericField

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Texts as Table cells.

func (*NumericField) SetVisible added in v0.0.68

func (p *NumericField) SetVisible(visible bool) *NumericField

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*NumericField) Status added in v0.0.68

func (p *NumericField) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*NumericField) String added in v0.0.56

func (nf *NumericField) String() string

Returns a string representation of this primitive: the numeric entry. Implements of fmt:Stringer interface.

func (*NumericField) Tag added in v0.0.56

func (nf *NumericField) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Texts as Table cells.

func (*NumericField) Visible added in v0.0.68

func (p *NumericField) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type NumericFieldWith added in v0.0.56

type NumericFieldWith struct {
	Embodiment   string
	NumericEntry string
	Status       int
	Tag          string
}

A field for entering numeric values.

func (NumericFieldWith) Make added in v0.0.56

func (w NumericFieldWith) Make() *NumericField

Creates a new NumericField primitive using the supplied field assignments.

type Primitive added in v0.0.38

type Primitive interface {
	fmt.Stringer
	PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)
	UnprepareForUpdates()
	LocateNextDescendant(locator *key.PKeyLocator) Primitive
	EgestUpdate(fullupdate bool, fkeys []key.FKey) map[any]any
	IngestUpdate(update map[any]any) error
}

func VA added in v0.0.62

func VA(primitives ...Primitive) []Primitive

Adapts a Variable Argument list of primitives to an array of primitives. Can also be used to create an empty array of primitives.

type PrimitiveBase added in v0.0.38

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

PrimitiveBase fields for primitive updates.

func (*PrimitiveBase) EgestUpdate added in v0.0.38

func (r *PrimitiveBase) EgestUpdate(fullupdate bool, fkeys []key.FKey) map[any]any

func (*PrimitiveBase) IndexOf added in v0.0.40

func (r *PrimitiveBase) IndexOf(parentLevel int) int

Returns the index of this primitive in a parent container specified by parentLevel as follows: parentLevel = 0, immediate parent container parentLevel = 1, grandparent parentLevel = 2, great grandparent And so on.

It returns -1 if parentLevel is a negative number or is invalid given the depth where the primitive belongs.

func (*PrimitiveBase) IngestUpdate added in v0.0.38

func (r *PrimitiveBase) IngestUpdate(update map[any]any) error

func (*PrimitiveBase) InternalPrepareForUpdates added in v0.0.38

func (r *PrimitiveBase) InternalPrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider, getFields func() []FieldRef)

func (*PrimitiveBase) LocateNextDescendant added in v0.0.38

func (r *PrimitiveBase) LocateNextDescendant(locator *key.PKeyLocator) Primitive

func (*PrimitiveBase) String added in v0.0.40

func (r *PrimitiveBase) String() string

Default implementation of fmt:Stringer interface.

func (*PrimitiveBase) UnprepareForUpdates added in v0.0.67

func (r *PrimitiveBase) UnprepareForUpdates()

type ProntoGUI added in v0.0.11

type ProntoGUI interface {
	// StartServing is deprecated. Use StartServingSingle instead, which has
	// the exact same semantics.
	StartServing(addr string, port int) error

	// StartServingSingle begins listening at addr:port for a single client
	// session. Only one client is handled at a time; additional session
	// attempts are rejected. When the active client disconnects, a new client
	// may establish a session. Use SetGUI, Wait, WaitOrCancel, and Update to interact
	// with the connected client.
	StartServingSingle(addr string, port int) error

	// StartServingMultiple begins listening at addr:port for multiple client
	// sessions. Up to maxSessions clients may be connected simultaneously;
	// session attempts beyond this limit are rejected. Use AcceptSession to
	// obtain a Session for each connected client.
	StartServingMultiple(addr string, port int, maxSessions int) error

	// StopServing shuts down the server and closes all active connections.
	StopServing()

	// AcceptSession blocks until a new client connects and returns a Session
	// for that client. Only valid in multi-connection mode (after calling
	// StartServingMultiple); returns an error if called in single-connection mode.
	// It returns ErrCanceled if the context was canceled or ErrInterrupted if
	// the caller interrupted the operation.
	AcceptSession(ctx context.Context, interrupt chan bool) (Session, error)

	// SetGUI sets the top-level primitives that define the GUI. Single-connection
	// mode only. May be called before a client connects; the GUI will be sent
	// once the first client connects.
	SetGUI(primitives ...Primitive) error

	// Wait sends the current GUI state to the client and blocks until the client
	// sends back an update. Returns the Primitive that was updated, or an error
	// if the client disconnects. Single-connection mode only.
	Wait() (Primitive, error)

	// WaitOrCancel is like Wait but also returns if the context is canceled
	// or the interrupt channel is selected.
	// Returns error of ErrCanceled if it was canceled or ErrInterrupted if
	// interrupted by the caller.
	// Single-connection mode only.
	WaitOrCancel(ctx context.Context, interrupt chan bool) (Primitive, error)

	// Update sends the current GUI state to the client and checks for an
	// inbound update without blocking. Returns nil if no update is available.
	// Single-connection mode only.
	Update() (Primitive, error)
}

ProntoGUI is the API for streaming a GUI to one or more App clients over gRPC.

There are two modes of operation:

Single-connection mode: call StartServingSingle, then use SetGUI, Wait, WaitOrCancel, and Update to manage the GUI directly. Only one client is served at a time, but clients may disconnect and reconnect freely.

Multi-connection mode: call StartServingMultiple, then call AcceptSession in a loop. Each returned Session has its own SetGUI, Wait, etc. methods for managing that client's GUI independently.

func NewProntoGUI added in v0.0.11

func NewProntoGUI() ProntoGUI

NewProntoGUI creates a new ProntoGUI instance.

type Session added in v1.0.0

type Session interface {
	// SetGUI sets the top-level primitives that define the GUI.
	SetGUI(primitives ...Primitive)

	// Wait sends the current GUI state to the client and blocks until the
	// client sends back an update. Returns the Primitive that was updated,
	// or an error if unsuccessful.
	Wait() (Primitive, error)

	// WaitOrCancel is like Wait but also returns ErrCanceled if the context
	// is canceled or ErrInterrupted if the interrupt channel is selected
	// before an update arrives.
	WaitOrCancel(ctx context.Context, interrupt chan bool) (Primitive, error)

	// Update sends the current GUI state to the client and checks for an
	// inbound update without blocking. Returns nil if no update is available.
	Update() (Primitive, error)
}

Session represents a single client connection with its own GUI lifecycle.

func NewSession added in v1.0.0

func NewSession(apicall *pgcomm.StreamingAPICall) Session

NewSession creates a new Session bound to the given streaming API call.

type String1DField added in v0.0.56

type String1DField struct {
	FieldBase
	// contains filtered or unexported fields
}

func (*String1DField) EgestValue added in v0.0.56

func (f *String1DField) EgestValue() any

func (*String1DField) Get added in v0.0.56

func (f *String1DField) Get() []string

func (*String1DField) IngestValue added in v0.0.56

func (f *String1DField) IngestValue(value any) error

func (*String1DField) PrepareForUpdates added in v0.0.56

func (f *String1DField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*String1DField) Set added in v0.0.56

func (f *String1DField) Set(sa []string)

type StringField added in v0.0.38

type StringField struct {
	FieldBase
	// contains filtered or unexported fields
}

func (*StringField) EgestValue added in v0.0.38

func (f *StringField) EgestValue() any

func (*StringField) Get added in v0.0.38

func (f *StringField) Get() string

func (*StringField) IngestValue added in v0.0.38

func (f *StringField) IngestValue(value any) error

func (*StringField) PrepareForUpdates added in v0.0.38

func (f *StringField) PrepareForUpdates(fkey key.FKey, pkey key.PKey, fieldPKeyIndex int, onset key.OnSetFunction, etsprovider EventTimestampProvider) (isContainer bool)

func (*StringField) Set added in v0.0.38

func (f *StringField) Set(s string)

type Synchro added in v0.0.11

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

func NewSynchro added in v0.0.11

func NewSynchro() *Synchro

func (*Synchro) GetFullUpdate added in v0.0.11

func (s *Synchro) GetFullUpdate() ([]byte, error)

func (*Synchro) GetPartialUpdate added in v0.0.11

func (s *Synchro) GetPartialUpdate() ([]byte, error)

func (*Synchro) GetTopPrimitives added in v0.0.11

func (s *Synchro) GetTopPrimitives() []Primitive

func (*Synchro) IngestUpdate added in v0.0.11

func (s *Synchro) IngestUpdate(updatesCbor []byte) (updatedPrimitive Primitive, updateError error)

func (*Synchro) OnSet added in v0.0.11

func (s *Synchro) OnSet(pkey key.PKey, fkey key.FKey, structural bool)

func (*Synchro) SetTopPrimitives added in v0.0.11

func (s *Synchro) SetTopPrimitives(etsprovider EventTimestampProvider, primitives ...Primitive)

type Table added in v0.0.35

type Table struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A table displays an array of primitives in a grid of rows and columns.

func NewTable added in v0.0.40

func NewTable() *Table

Creates a new Table primitive.

func (*Table) Collapsed added in v0.0.68

func (p *Table) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Table) DeleteAllRows added in v0.0.50

func (table *Table) DeleteAllRows()

Deletes all rows from the table.

func (*Table) DeleteRow added in v0.0.40

func (table *Table) DeleteRow(index int) error

Deletes a row in this table at the given index. An error is returned if the index is out of range.

func (*Table) Embodiment added in v0.0.35

func (table *Table) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Table) Enabled added in v0.0.68

func (p *Table) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Table) GetHeadings added in v0.0.62

func (table *Table) GetHeadings() []string

Generates a list of headings from each primitive in the HeaderRow. Although these are typically Text primitives, the scan relies on the primitive's string representation to allow for more general use.

func (*Table) HeaderRow added in v0.0.61

func (table *Table) HeaderRow() []Primitive

Returns the header row that describes each column in the table.

func (*Table) InsertRow added in v0.0.40

func (table *Table) InsertRow(index int, row []Primitive)

Inserts a new row in this table before the index specified. If index is -1 or extends beyond the number of rows in the table then row is appended at the end of the table. The row must match the dimension and cell types of the template row

func (*Table) LocateNextDescendant added in v0.0.35

func (table *Table) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*Table) MakeHeadings added in v0.0.61

func (table *Table) MakeHeadings(headings []string) *Table

Constructs the HeaderRow from Text primitives, each holding content from the corresponding string provided in the headings argument.

func (*Table) MakeHeadingsVA added in v0.0.62

func (table *Table) MakeHeadingsVA(headings ...string) *Table

Constructs the HeaderRow from Text primitives, each holding content from the corresponding string provided in the variable argument list.

func (*Table) ModelRow added in v0.0.56

func (table *Table) ModelRow() []Primitive

Returns the model row.

func (*Table) PrepareForUpdates added in v0.0.35

func (table *Table) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Table) RowCount added in v0.0.47

func (table *Table) RowCount() int

Convenience function that returns the number of rows.

func (*Table) Rows added in v0.0.35

func (table *Table) Rows() [][]Primitive

Returns the dynamically populated 2D (rows, cols) collection of primitives that appear in the table.

func (*Table) SelectedRows added in v0.0.68

func (table *Table) SelectedRows() []int

Returns the selected rows.

func (*Table) SelectionChanged added in v0.0.68

func (cmd *Table) SelectionChanged() bool

Returns true if the selection was changed.

func (*Table) SelectionMode added in v0.0.68

func (table *Table) SelectionMode() int

Returns the status of the table: 0 = None, 1 = One Always Selected, 2 = One or None, 3 = Multiple 4 = Range Atleast One, 5 = Range Any or None at all.

func (*Table) SetCollapsed added in v0.0.68

func (p *Table) SetCollapsed(collapsed bool) *Table

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Table) SetEmbodiment added in v0.0.35

func (table *Table) SetEmbodiment(s string) *Table

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Table) SetEnabled added in v0.0.68

func (p *Table) SetEnabled(enabled bool) *Table

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Table) SetHeaderRow added in v0.0.61

func (table *Table) SetHeaderRow(items []Primitive) *Table

Sets the headings to use for each column in the table.

func (*Table) SetHeaderRowVA added in v0.0.61

func (table *Table) SetHeaderRowVA(items ...Primitive) *Table

Sets the headings (as variadic arguments) to use for each column in the table.

func (*Table) SetModelRow added in v0.0.56

func (table *Table) SetModelRow(items []Primitive) *Table

Sets the model row.

func (*Table) SetRows added in v0.0.35

func (table *Table) SetRows(items [][]Primitive) *Table

Sets the dynamically populated 2D (rows, cols) collection of primitives that appear in the table.

func (*Table) SetSelectedRows added in v0.0.68

func (table *Table) SetSelectedRows(selected []int) *Table

Sets the selected rows.

func (*Table) SetSelectionMode added in v0.0.68

func (table *Table) SetSelectionMode(mode int) *Table

Sets the selection mode: 0 = None, 1 = One Always Selected, 2 = One or None, 3 = Multiple 4 = Range Atleast One, 5 = Range Any or None at all.

func (*Table) SetStatus added in v0.0.40

func (p *Table) SetStatus(i int) *Table

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Table) SetTag added in v0.0.41

func (table *Table) SetTag(s string) *Table

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Tables inside other containers.

func (*Table) SetVisible added in v0.0.68

func (p *Table) SetVisible(visible bool) *Table

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Table) Status added in v0.0.40

func (p *Table) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Table) Tag added in v0.0.41

func (table *Table) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Tables inside other containers.

func (*Table) Visible added in v0.0.68

func (p *Table) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type TableWith added in v0.0.35

type TableWith struct {
	Embodiment    string
	HeaderRow     []Primitive
	ModelRow      []Primitive
	Rows          [][]Primitive
	SelectedRows  []int
	SelectionMode int
	Status        int
	Tag           string
}

A table displays an array of primitives in a grid of rows and columns.

func (TableWith) Make added in v0.0.35

func (w TableWith) Make() *Table

Creates a new Table using the supplied field assignments.

type TestPrimitive added in v0.0.38

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

func (*TestPrimitive) EgestUpdate added in v0.0.38

func (tp *TestPrimitive) EgestUpdate(fullupdate bool, fkeys []key.FKey) map[any]any

func (*TestPrimitive) IngestUpdate added in v0.0.38

func (tp *TestPrimitive) IngestUpdate(update map[any]any) error

func (*TestPrimitive) IsPrepped added in v0.0.38

func (tp *TestPrimitive) IsPrepped() bool

func (*TestPrimitive) LocateNextDescendant added in v0.0.38

func (tp *TestPrimitive) LocateNextDescendant(locator *key.PKeyLocator) Primitive

func (*TestPrimitive) PrepareForUpdates added in v0.0.38

func (tp *TestPrimitive) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

func (*TestPrimitive) String added in v0.0.40

func (tp *TestPrimitive) String() string

func (*TestPrimitive) UnprepareForUpdates added in v0.0.67

func (tp *TestPrimitive) UnprepareForUpdates()

type Text added in v0.0.15

type Text struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A text primitive displays text on the screen.

func NewText added in v0.0.40

func NewText(content string) *Text

Create a new Text and assign its content.

func (*Text) Collapsed added in v0.0.68

func (p *Text) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Text) Content added in v0.0.15

func (txt *Text) Content() string

Returns the text content to display.

func (*Text) Embodiment added in v0.0.27

func (txt *Text) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Text) Enabled added in v0.0.68

func (p *Text) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Text) PrepareForUpdates added in v0.0.15

func (txt *Text) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Text) SetCollapsed added in v0.0.68

func (p *Text) SetCollapsed(collapsed bool) *Text

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Text) SetContent added in v0.0.15

func (txt *Text) SetContent(s string) *Text

Sets the text content to display.

func (*Text) SetEmbodiment added in v0.0.27

func (txt *Text) SetEmbodiment(s string) *Text

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Text) SetEnabled added in v0.0.68

func (p *Text) SetEnabled(enabled bool) *Text

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Text) SetStatus added in v0.0.68

func (p *Text) SetStatus(i int) *Text

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Text) SetTag added in v0.0.41

func (txt *Text) SetTag(s string) *Text

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Texts as Table cells.

func (*Text) SetVisible added in v0.0.68

func (p *Text) SetVisible(visible bool) *Text

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Text) Status added in v0.0.68

func (p *Text) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Text) String added in v0.0.40

func (txt *Text) String() string

Returns a string representation of this primitive: the content. Implements of fmt:Stringer interface.

func (*Text) Tag added in v0.0.41

func (txt *Text) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Texts as Table cells.

func (*Text) Visible added in v0.0.68

func (p *Text) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type TextField added in v0.0.28

type TextField struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

An entry field that allows the user to enter text.

func NewTextField added in v0.0.40

func NewTextField(textEntry string) *TextField

Create a new TextField with initial text.

func (*TextField) Collapsed added in v0.0.68

func (p *TextField) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*TextField) Embodiment added in v0.0.28

func (txt *TextField) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*TextField) Enabled added in v0.0.68

func (p *TextField) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*TextField) PrepareForUpdates added in v0.0.28

func (txt *TextField) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*TextField) SetCollapsed added in v0.0.68

func (p *TextField) SetCollapsed(collapsed bool) *TextField

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*TextField) SetEmbodiment added in v0.0.28

func (txt *TextField) SetEmbodiment(s string) *TextField

Sets a JSON string specifying the embodiment to use for this primitive.

func (*TextField) SetEnabled added in v0.0.68

func (p *TextField) SetEnabled(enabled bool) *TextField

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*TextField) SetStatus added in v0.0.68

func (p *TextField) SetStatus(i int) *TextField

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*TextField) SetTag added in v0.0.41

func (txt *TextField) SetTag(s string) *TextField

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using TextFields as Table cells.

func (*TextField) SetTextEntry added in v0.0.28

func (txt *TextField) SetTextEntry(s string) *TextField

Sets the text entered by the user.

func (*TextField) SetVisible added in v0.0.68

func (p *TextField) SetVisible(visible bool) *TextField

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*TextField) Status added in v0.0.68

func (p *TextField) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*TextField) String added in v0.0.40

func (txt *TextField) String() string

Returns a string representation of this primitive: the text entry. Implements of fmt:Stringer interface.

func (*TextField) Tag added in v0.0.41

func (txt *TextField) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using TextFields as Table cells.

func (*TextField) TextEntry added in v0.0.28

func (txt *TextField) TextEntry() string

Returns the text entered by the user.

func (*TextField) Visible added in v0.0.68

func (p *TextField) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type TextFieldWith added in v0.0.28

type TextFieldWith struct {
	Embodiment string
	Status     int
	Tag        string
	TextEntry  string
}

An entry field that allows the user to enter text.

func (TextFieldWith) Make added in v0.0.28

func (w TextFieldWith) Make() *TextField

Creates a new TextField using the supplied field assignments.

type TextWith added in v0.0.18

type TextWith struct {
	Content    string
	Embodiment string
	Status     int
	Tag        string
}

A text primitive displays text on the screen.

func (TextWith) Make added in v0.0.18

func (w TextWith) Make() *Text

Creates a new Text primitive using the supplied field assignments.

type Timer added in v0.0.37

type Timer struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A timer is an invisible primitive that fires an event, triggering an update to the server. This is useful for low-precision GUI updates that originate on the server side. An example is updating "live" readings from a running process on the server.

func NewTimer added in v0.0.40

func NewTimer(periodMs int) *Timer

Create a new Timer with period in milliseconds.

func (*Timer) Collapsed added in v0.0.68

func (p *Timer) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Timer) Embodiment added in v0.0.37

func (tmr *Timer) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Timer) Enabled added in v0.0.68

func (p *Timer) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Timer) Issued added in v0.0.56

func (tmr *Timer) Issued() bool

Returns true if the command was issued during the current Wait cycle.

func (*Timer) PeriodMs added in v0.0.37

func (tmr *Timer) PeriodMs() int

Returns the time period in milliseconds after which the timer fires an event. If the period is -1 (or any negative number) then the timer is disabled. A period of 0 will cause the timer to fire immediately after the primitive is updated.

func (*Timer) PrepareForUpdates added in v0.0.37

func (tmr *Timer) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Timer) SetCollapsed added in v0.0.68

func (p *Timer) SetCollapsed(collapsed bool) *Timer

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Timer) SetEmbodiment added in v0.0.37

func (tmr *Timer) SetEmbodiment(s string) *Timer

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Timer) SetEnabled added in v0.0.68

func (p *Timer) SetEnabled(enabled bool) *Timer

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Timer) SetPeriodMs added in v0.0.37

func (tmr *Timer) SetPeriodMs(i int) *Timer

Sets the time period in milliseconds after which the timer fires an event. If the period is -1 (or any negative number) then the timer is disabled. A period of 0 will cause the timer to fire immediately after the primitive is updated.

func (*Timer) SetStatus added in v0.0.68

func (p *Timer) SetStatus(i int) *Timer

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Timer) SetTag added in v0.0.41

func (tmr *Timer) SetTag(s string) *Timer

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Timers inside containers.

func (*Timer) SetVisible added in v0.0.68

func (p *Timer) SetVisible(visible bool) *Timer

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Timer) Status added in v0.0.68

func (p *Timer) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Timer) Tag added in v0.0.41

func (tmr *Timer) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Timers inside containers.

func (*Timer) Visible added in v0.0.68

func (p *Timer) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type TimerWith added in v0.0.37

type TimerWith struct {
	Embodiment string
	PeriodMs   int
	Status     int
	Tag        string
}

A timer is an invisible primitive that fires an event, triggering an update to the server. This is useful for low-precision GUI updates that originate on the server side. An example is updating "live" readings from a running process on the server.

func (TimerWith) Make added in v0.0.37

func (w TimerWith) Make() *Timer

Makes a new Timer with specified field values.

type Tristate added in v0.0.16

type Tristate struct {
	// Mix-in the common guts for primitives
	PrimitiveBase
	// contains filtered or unexported fields
}

A choice presented to the user that give three possible states: Affirmative (Yes, On, 1, etc.), Negative (No, Off, 0, etc.), and Indeterminate.

func NewTristate added in v0.0.40

func NewTristate(label string) *Tristate

Create a new TriState and assign a label.

func (*Tristate) Collapsed added in v0.0.68

func (p *Tristate) Collapsed() bool

Returns the collapsed status of the primitive. This is derived from the Status field.

func (*Tristate) Embodiment added in v0.0.27

func (tri *Tristate) Embodiment() string

Returns a JSON string specifying the embodiment to use for this primitive.

func (*Tristate) Enabled added in v0.0.68

func (p *Tristate) Enabled() bool

Returns the enabled status of the primitive. This is derived from the Status field.

func (*Tristate) Label added in v0.0.16

func (tri *Tristate) Label() string

Returns the label to display along with the tristate option.

func (*Tristate) LabelItem added in v0.0.63

func (tri *Tristate) LabelItem() Primitive

Returns the label to display in the command.

func (*Tristate) LocateNextDescendant added in v0.0.63

func (tri *Tristate) LocateNextDescendant(locator *key.PKeyLocator) Primitive

A non-recursive method to locate descendants by PKey. This is used internally by this library and normally should not be called by users of the library.

func (*Tristate) PrepareForUpdates added in v0.0.16

func (tri *Tristate) PrepareForUpdates(pkey key.PKey, onset key.OnSetFunction, etsprovider EventTimestampProvider)

Prepares the primitive for tracking pending updates to send to the app and for injesting updates from the app. This is used internally by this library and normally should not be called by users of the library.

func (*Tristate) SetCollapsed added in v0.0.68

func (p *Tristate) SetCollapsed(collapsed bool) *Tristate

Sets the collapsed status of the primitive. Setting this to true will set Status to 3 (collapsed) and setting this to false will set Status to 0 (visible & enabled).

func (*Tristate) SetEmbodiment added in v0.0.27

func (tri *Tristate) SetEmbodiment(s string) *Tristate

Sets a JSON string specifying the embodiment to use for this primitive.

func (*Tristate) SetEnabled added in v0.0.68

func (p *Tristate) SetEnabled(enabled bool) *Tristate

Sets the enabled status of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 1 (disabled).

func (*Tristate) SetLabel added in v0.0.16

func (tri *Tristate) SetLabel(s string) *Tristate

Sets the label to display along with the tristate option.

func (*Tristate) SetLabelItem added in v0.0.63

func (tri *Tristate) SetLabelItem(item Primitive) *Tristate

Sets the label to display in the command.

func (*Tristate) SetState added in v0.0.16

func (tri *Tristate) SetState(i int) *Tristate

Sets the state of the option (0 = Negative, 1 = Affirmative, and -1 = Indeterminate).

func (*Tristate) SetStatus added in v0.0.68

func (p *Tristate) SetStatus(i int) *Tristate

Sets the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Tristate) SetTag added in v0.0.41

func (tri *Tristate) SetTag(s string) *Tristate

Sets an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Tristates as Table cells.

func (*Tristate) SetVisible added in v0.0.68

func (p *Tristate) SetVisible(visible bool) *Tristate

Sets the visibility of the primitive. Setting this to true will set Status to 0 (visible & enabled) and setting this to false will set Status to 2 (hidden).

func (*Tristate) State added in v0.0.16

func (tri *Tristate) State() int

Returns the state of the option (0 = Negative, 1 = Affirmative, and -1 = Indeterminate).

func (*Tristate) Status added in v0.0.68

func (p *Tristate) Status() int

Returns the status of the primitive: 0 = visible and enabled, 1 = visible and disabled, 2 = hidden and disabled, 3 = collapsed and disabled.

func (*Tristate) String added in v0.0.40

func (tri *Tristate) String() string

Returns a string representation of this primitive: the label. Implements of fmt:Stringer interface.

func (*Tristate) Tag added in v0.0.41

func (tri *Tristate) Tag() string

Returns an optional and arbitrary string to keep with this primitive. This is useful for identification later on, such as using Tristates as Table cells.

func (*Tristate) Visible added in v0.0.68

func (p *Tristate) Visible() bool

Returns the visibility of the group. This is derived from the Status field.

type TristateWith added in v0.0.17

type TristateWith struct {
	Embodiment string
	Label      string
	LabelItem  Primitive
	State      int
	Status     int
	Tag        string
}

A choice presented to the user that give three possible states: Affirmative (Yes, On, 1, etc.), Negative (No, Off, 0, etc.), and Indeterminate.

func (TristateWith) Make added in v0.0.17

func (w TristateWith) Make() *Tristate

Creates a new TriState using the supplied field assignments.

type Update added in v0.0.11

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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