summaryrefslogtreecommitdiff
path: root/common/structs.go
blob: 32eed8a668405d6a9953ea46e32c945c2890fac9 (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
package main

/*
	These code should be common to all gui plugins

	There are some helper functions that are probably going to be
	the same everywhere. Mostly due to handling the binary tree structure
	and the channel communication

	For now, it's just a symlink to the 'master' version in
	./toolkit/nocui/common.go
*/

import (
	"reflect"
	"strconv"

	"go.wit.com/log"
	"go.wit.com/gui/widget"
)

// this is the channel we send user events like
// mouse clicks or keyboard events back to the program
var callback chan widget.Action

// this is the channel we get requests to make widgets
var pluginChan chan widget.Action

type Node struct {
	parent	*node
	children []*node

	WidgetId	int	// widget ID
	WidgetType	widget.WidgetType
	ParentId	int	// parent ID

	State	widget.State

	// the internal plugin toolkit structure
	// in the gtk plugin, it has gtk things like margin & border settings
	// in the text console one, it has text console things like colors for menus & buttons
	TK any
}