summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/grid.go
blob: f009ab39fbc17a3be3afdbf8683095ca28f5e721 (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
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.Widget.Name, "to", a.Where.Type)

	t := mapToolkits[a.Where]

	newt = new(andlabsT)

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

	place(a, t, newt)
	mapWidgetsToolkits(a, newt)
}