summaryrefslogtreecommitdiff
path: root/grid.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-28 01:05:06 -0400
committerPietro Gagliardi <[email protected]>2014-06-28 01:05:06 -0400
commitea6200a432c2954ec2b38afc66d1795dd161e8d9 (patch)
tree10665ae3e2ed42bb6a16027b7eb40adf7c8dee58 /grid.go
parent05ffc6511ab11fa365b2e8961bc67770bbf79777 (diff)
Began the migration to the new API. Removed locks from the public control APIs; they won't be needed anymore.
Diffstat (limited to 'grid.go')
-rw-r--r--grid.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/grid.go b/grid.go
index b1c2a52..bc58a00 100644
--- a/grid.go
+++ b/grid.go
@@ -4,7 +4,6 @@ package ui
import (
"fmt"
- "sync"
)
// A Grid arranges Controls in a two-dimensional grid.
@@ -16,7 +15,6 @@ import (
// A stretchy Control implicitly fills its cell.
// All cooridnates in a Grid are given in (row,column) form with (0,0) being the top-left cell.
type Grid struct {
- lock sync.Mutex
created bool
controls [][]Control
filling [][]bool
@@ -69,9 +67,6 @@ func NewGrid(nPerRow int, controls ...Control) *Grid {
// This function cannot be called after the Window that contains the Grid has been created.
// It panics if the given coordinate is invalid.
func (g *Grid) SetFilling(row int, column int) {
- g.lock.Lock()
- defer g.lock.Unlock()
-
if g.created {
panic(fmt.Errorf("Grid.SetFilling() called after window create"))
}
@@ -87,9 +82,6 @@ func (g *Grid) SetFilling(row int, column int) {
// This function cannot be called after the Window that contains the Grid has been created.
// It panics if the given coordinate is invalid.
func (g *Grid) SetStretchy(row int, column int) {
- g.lock.Lock()
- defer g.lock.Unlock()
-
if g.created {
panic(fmt.Errorf("Grid.SetFilling() called after window create"))
}
@@ -102,9 +94,6 @@ func (g *Grid) SetStretchy(row int, column int) {
}
func (g *Grid) make(window *sysData) error {
- g.lock.Lock()
- defer g.lock.Unlock()
-
// commit filling for the stretchy control now (see SetStretchy() above)
if g.stretchyrow != -1 && g.stretchycol != -1 {
g.filling[g.stretchyrow][g.stretchycol] = true