tk

package
v0.0.0-...-b34c1d9 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Binding      = regexp.MustCompile(`^<.*?>$`)
	Event        = regexp.MustCompile(`^<.*?>$`)
	VirtualEvent = regexp.MustCompile(`^<<.*?>>$`)
)

Functions

This section is empty.

Types

type Tk

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

Tk is the main interpreter.

func Get

func Get() *Tk

Get gets the global instance of the interpreter.

func (*Tk) CreateBindCommand

func (tk *Tk) CreateBindCommand(el element.Element, name string, callback command.BindCallback)

CreateBindCommand creates a custom command in the interpreter.

func (*Tk) CreateCommand

func (tk *Tk) CreateCommand(el element.Element, name string, callback command.Callback)

CreateCommand creates a custom command in the interpreter.

func (*Tk) CreateFontDialogCommand

func (tk *Tk) CreateFontDialogCommand(el element.Element, name string, callback command.FontDialogCallback)

CreateFontDialogCommand creates a custom command in the interpreter.

func (*Tk) Destroy

func (tk *Tk) Destroy()

Destroy deletes the interpreter and cleans up its resources.

func (*Tk) DestroyCommand

func (tk *Tk) DestroyCommand(name string)

DestroyCommand destroys a command and cleans up its resources.

func (*Tk) DestroyVar

func (tk *Tk) DestroyVar(name string)

DestroyVar destroys a variable and cleans up its resources.

func (*Tk) Eval

func (tk *Tk) Eval(format string, a ...any)

Eval passes the specified command to the interpreter for evaluation. This will end the program on any error.

func (*Tk) GetBoolResult

func (tk *Tk) GetBoolResult() bool

GetBoolResult gets the interpreter result as a boolean.

func (*Tk) GetFloatResult

func (tk *Tk) GetFloatResult() float64

GetFloatResult gets the interpreter result as a float.

func (*Tk) GetIntResult

func (tk *Tk) GetIntResult() int

GetStrResult gets the interpreter result as a string.

func (*Tk) GetStrResult

func (tk *Tk) GetStrResult() string

GetStrResult gets the interpreter result as a string.

func (*Tk) GetStrSliceResult

func (tk *Tk) GetStrSliceResult() []string

func (*Tk) GetVarBoolValue

func (tk *Tk) GetVarBoolValue(name string) bool

GetVarBoolValue gets the named variable value as a boolean.

func (*Tk) GetVarFloatValue

func (tk *Tk) GetVarFloatValue(name string) float64

GetVarFloatValue gets the named variable value as a float.

func (*Tk) GetVarIntValue

func (tk *Tk) GetVarIntValue(name string) int

GetVarIntValue gets the named variable value as an integer.

func (*Tk) GetVarStrValue

func (tk *Tk) GetVarStrValue(name string) string

GetVarStrValue gets the named variable value as a string.

func (*Tk) SetVarFloatValue

func (tk *Tk) SetVarFloatValue(name string, val float64)

SetVarFloatValue sets the named variable value using a string.

func (*Tk) SetVarStrValue

func (tk *Tk) SetVarStrValue(name string, val string)

SetVarStrValue sets the named variable value using a string.

func (*Tk) Start

func (tk *Tk) Start()

Start starts the app main loop. This will immediately show the main window and will block until the main window is closed. When this method exits, the interpreter is destroyed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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