summary refs log tree commit diff stats
path: root/lib/ui/grid.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui/grid.go')
-rw-r--r--lib/ui/grid.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/ui/grid.go b/lib/ui/grid.go
index 3f5dd60..96da1cb 100644
--- a/lib/ui/grid.go
+++ b/lib/ui/grid.go
@@ -54,6 +54,20 @@ func NewGrid() *Grid {
 	return &Grid{invalid: true}
 }
 
+// MakeGrid creates a grid with the specified number of columns and rows. Each
+// cell has a size of 1.
+func MakeGrid(numRows, numCols, rowStrategy, colStrategy int) *Grid {
+	rows := make([]GridSpec, numRows)
+	for i := 0; i < numRows; i++ {
+		rows[i] = GridSpec{rowStrategy, 1}
+	}
+	cols := make([]GridSpec, numCols)
+	for i := 0; i < numCols; i++ {
+		cols[i] = GridSpec{colStrategy, 1}
+	}
+	return NewGrid().Rows(rows).Columns(cols)
+}
+
 func (cell *GridCell) At(row, col int) *GridCell {
 	cell.Row = row
 	cell.Column = col
evision' href='/acidbong/suckless/dwm/blame/config.arg.h?h=5.7.2&id=a55f0e12fe5c1205f4d3e40c164fd087224fad7a'>^
1bf0c4a ^
a73a882 ^
b38905b ^
a73a882 ^

b355755 ^




a73a882 ^




f504aea ^


a73a882 ^

b355755 ^









a73a882 ^

9955ddc ^


a73a882 ^



e21d93b ^




a73a882 ^
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61