toolkit

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugToolkit bool

Functions

func BlankWindow

func BlankWindow(w *ui.Window) *ui.Box

func GetDebugToolkit

func GetDebugToolkit() bool

func Main

func Main(f func())

func Queue

func Queue(f func())

Other goroutines must use this to access the GUI

You can not acess / process the GUI thread directly from other goroutines. This is due to the nature of how Linux, MacOS and Windows work (they all work differently. suprise. surprise.)

For example: Queue(NewWindow())

func SetDebugToolkit

func SetDebugToolkit(s bool)

Types

type Toolkit

type Toolkit struct {
	Name   string
	Width  int
	Height int

	OnChanged func(*Toolkit)
	OnExit    func(*Toolkit)

	Custom func()

	UiWindowBad *ui.Window
	// contains filtered or unexported fields
}

stores the raw toolkit internals

func NewWindow

func NewWindow(title string, x int, y int) *Toolkit

func (*Toolkit) AddDropdown

func (t *Toolkit) AddDropdown(title string)

func (*Toolkit) AddTab

func (t *Toolkit) AddTab(name string) *Toolkit

This adds a tab

andlabs/ui is goofy in the sense that you have to determine if the ui.Window already has a tab in it. If it does, then you need to add this tab and not run SetChild() on the window or instead it replaces the existing tab with the new one

I work around this by always sending a Toolkit that is a tab once there is one. If you send a Window here, it will replace any existing tabs rather than adding a new one

func (Toolkit) Checked

func (t Toolkit) Checked() bool

func (*Toolkit) DemoNumbersPage

func (t *Toolkit) DemoNumbersPage()

func (*Toolkit) Dump

func (t *Toolkit) Dump()

func (*Toolkit) ErrorWindow

func (t *Toolkit) ErrorWindow(msg1 string, msg2 string)

func (*Toolkit) GetBox

func (t *Toolkit) GetBox() *ui.Box

create a new box

func (*Toolkit) GetText

func (t *Toolkit) GetText() string

func (*Toolkit) MessageWindow

func (t *Toolkit) MessageWindow(msg1 string, msg2 string)

func (*Toolkit) NewBox

func (t *Toolkit) NewBox() *Toolkit

create a new box

func (Toolkit) NewButton

func (t Toolkit) NewButton(name string) *Toolkit

make new Group here

func (Toolkit) NewCheckbox

func (t Toolkit) NewCheckbox(name string) *Toolkit

func (*Toolkit) NewDropdown

func (t *Toolkit) NewDropdown(title string) *Toolkit

func (Toolkit) NewGroup

func (t Toolkit) NewGroup(title string) *Toolkit

make new Group here

func (*Toolkit) NewLabel

func (t *Toolkit) NewLabel(name string) *Toolkit

func (Toolkit) NewSlider

func (t Toolkit) NewSlider(title string, x int, y int) *Toolkit

func (Toolkit) NewSpinner

func (t Toolkit) NewSpinner(title string, x int, y int) *Toolkit

func (Toolkit) NewTextbox

func (t Toolkit) NewTextbox(name string) *Toolkit

func (Toolkit) SetDropdown

func (t Toolkit) SetDropdown(i int)

func (*Toolkit) SetText

func (t *Toolkit) SetText(s string) bool

func (*Toolkit) SetValue

func (t *Toolkit) SetValue(i int) bool

func (*Toolkit) SetWindowTitle

func (t *Toolkit) SetWindowTitle(title string)

func (*Toolkit) String

func (t *Toolkit) String() string

func (*Toolkit) Value

func (t *Toolkit) Value() int

Source Files

  • box.go
  • button.go
  • checkbox.go
  • common.go
  • demo.go
  • dropdown.go
  • group.go
  • label.go
  • main.go
  • slider.go
  • spinner.go
  • structs.go
  • tab.go
  • textbox.go
  • window.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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