summaryrefslogtreecommitdiff
path: root/grid.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-04 06:31:30 -0500
committerJeff Carr <[email protected]>2023-04-04 06:31:30 -0500
commitd6b1fa497dcb21e194348d321bfc25f6b128438f (patch)
treee653d621c1302dd58de4b8b280cd13f613e518b7 /grid.go
parent8982b2a8cfb10ad2ac2e50c0fcbdad88556e495a (diff)
gocui: use (w,h) and avoid (x,y) names
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'grid.go')
-rw-r--r--grid.go22
1 files changed, 13 insertions, 9 deletions
diff --git a/grid.go b/grid.go
index 859d2e3..18eb7d8 100644
--- a/grid.go
+++ b/grid.go
@@ -4,29 +4,33 @@ import (
"git.wit.org/wit/gui/toolkit"
)
-// Grid numbering examples (X) or (X,Y)
+// Grid numbering examples (H) or (W,H)
// ---------
// -- (1) --
// -- (2) --
// ---------
//
// -----------------------------
-// -- (1,1) -- (1,2) -- (1,3) --
-// -- (2,1) -- (2,2) -- (2,3) --
-// -- (3,1) -- -- (2,3) --
+// -- (1,1) -- (2,1) -- (3,1) --
+// -- (1,2) -- (2,2) -- (3,2) --
+// -- (1,3) -- -- (3,3) --
// -----------------------------
-func (n *Node) NewGrid(name string, x int, y int) *Node {
+func (n *Node) NewGrid(name string, w int, h int) *Node {
newNode := n.New(name, toolkit.Grid, func() {
log(debugChange, "click() NewGrid not defined =", name)
})
var a toolkit.Action
a.ActionType = toolkit.Add
- a.X = x
- a.Y = y
- newNode.X = x
- newNode.Y = y
+ a.Name = name
+ a.Text = name
+ a.X = w
+ a.Y = h
+ a.Width = w
+ a.Height = h
+ newNode.X = w
+ newNode.Y = h
newNode.NextX = 1
newNode.NextY = 1
newaction(&a, newNode, n)