summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/grid.go
blob: 2f91c86aec705a4f73471d7ee70f47ce3c344a42 (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
package main

import (
	"github.com/andlabs/ui"
	_ "github.com/andlabs/ui/winmanifest"

	"git.wit.org/wit/gui/toolkit"
)

// Grid numbering by (X,Y)
// -----------------------------
// -- (1,1) -- (2,1) -- (3,1) --
// -- (1,2) -- (2,1) -- (3,1) --
// -----------------------------
func newGrid(a *toolkit.Action) {
	var newt *andlabsT
	log(debugToolkit, "newGrid()", a.WidgetId, "to", a.ParentId)

	newt = new(andlabsT)

	c := ui.NewGrid()
	newt.uiGrid = c
	newt.uiControl = c
	newt.tw = a.Widget
	newt.WidgetType = toolkit.Grid
	newt.gridX = 0
	newt.gridY = 0

	t := andlabs[a.ParentId]
	place(a, t, newt)
}