summaryrefslogtreecommitdiff
path: root/andlabs/structs.go
blob: 87e88e118192423bfbe048d0d329e37dbbbec0e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main

import "go.wit.com/dev/andlabs/ui"
import _ "go.wit.com/dev/andlabs/ui/winmanifest"

// var andlabs map[int]*andlabsT
// var callback func(int) bool
// var callback chan toolkit.Action

// It's probably a terrible idea to call this 'me'
var me config

type config struct {
	rootNode *node // the base of the binary tree. it should have id == 0
}

// stores the raw toolkit internals
type guiWidget struct {
	Width  int
	Height int

	// tw	*toolkit.Widget
	parent	*guiWidget
	children []*guiWidget

	// used to track if a tab has a child widget yet
	child bool

	uiControl ui.Control

	uiBox     *ui.Box
	uiButton  *ui.Button
	uiCombobox *ui.Combobox
	uiCheckbox *ui.Checkbox
	uiEntry   *ui.Entry
	uiGroup   *ui.Group
	uiLabel   *ui.Label
	uiSlider  *ui.Slider
	uiSpinbox *ui.Spinbox
	uiTab     *ui.Tab
	uiWindow  *ui.Window
	uiMultilineEntry   *ui.MultilineEntry
	uiEditableCombobox    *ui.EditableCombobox
	uiImage  *ui.Image

	uiGrid    *ui.Grid
	gridX	int
	gridY	int

	// used as a counter to work around limitations of widgets like combobox
	// this is probably fucked up and in many ways wrong because of unsafe goroutine threading
	// but it's working for now due to the need for need for a correct interaction layer betten toolkits
	c int
	val map[int]string

	// andlabs/ui only accesses widget id numbers
	boxC int	// how many things on in a box or how many tabs
}