summaryrefslogtreecommitdiff
path: root/grid.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-17 20:42:36 -0400
committerPietro Gagliardi <[email protected]>2014-03-17 20:42:36 -0400
commit19227080da161bc96e4cc8ed447059cefbca8a6a (patch)
tree818f4d443f469ee962268449d86ca406a7399514 /grid.go
parentc078266c6d091610eb3acddd68090ee697142315 (diff)
Changed window resizes so that the actual Control.setRect() functions appended to an array of requests that the resize() function set all at once instead of having each done individually. This will be necessary for what I think will be a solution to the deadlocks. It doesn't work right now; I'm assuming it's allocating too much memory. I know how to fix this, but I'm committing what I have so far to be safe.
Diffstat (limited to 'grid.go')
-rw-r--r--grid.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/grid.go b/grid.go
index 309c5db..064dcab 100644
--- a/grid.go
+++ b/grid.go
@@ -120,7 +120,7 @@ func (g *Grid) make(window *sysData) error {
return nil
}
-func (g *Grid) setRect(x int, y int, width int, height int, winheight int) error {
+func (g *Grid) setRect(x int, y int, width int, height int) (rr []resizerequest) {
max := func(a int, b int) int {
if a > b {
return a
@@ -171,16 +171,13 @@ func (g *Grid) setRect(x int, y int, width int, height int, winheight int) error
w = g.colwidths[col]
h = g.rowheights[row]
}
- err := c.setRect(x, y, w, h, winheight)
- if err != nil {
- return fmt.Errorf("error setting size of control (%d,%d) in Grid.setRect(): %v", row, col, err)
- }
+ rr = append(rr, c.setRect(x, y, w, h)...)
x += g.colwidths[col]
}
x = startx
y += g.rowheights[row]
}
- return nil
+ return rr
}
// filling and stretchy are ignored for preferred size calculation