2023-03-03 14:41:38 -06:00
|
|
|
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) --
|
|
|
|
// -----------------------------
|
2023-03-23 12:35:12 -05:00
|
|
|
func newGrid(a *toolkit.Action) {
|
2023-03-03 14:41:38 -06:00
|
|
|
var newt *andlabsT
|
2023-03-23 12:35:12 -05:00
|
|
|
log(debugToolkit, "newGrid()", a.Widget.Name, "to", a.Where.Type)
|
2023-03-03 14:41:38 -06:00
|
|
|
|
2023-03-23 12:35:12 -05:00
|
|
|
t := mapToolkits[a.Where]
|
2023-03-03 14:41:38 -06:00
|
|
|
|
|
|
|
newt = new(andlabsT)
|
|
|
|
|
|
|
|
c := ui.NewGrid()
|
|
|
|
newt.uiGrid = c
|
2023-03-23 12:35:12 -05:00
|
|
|
newt.uiControl = c
|
|
|
|
newt.tw = a.Widget
|
|
|
|
newt.gridX = 0
|
|
|
|
newt.gridY = 0
|
2023-03-03 14:41:38 -06:00
|
|
|
|
2023-03-23 12:35:12 -05:00
|
|
|
place(a, t, newt)
|
|
|
|
mapWidgetsToolkits(a, newt)
|
2023-03-03 14:41:38 -06:00
|
|
|
}
|