summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-25 19:05:01 -0500
committerPietro Gagliardi <[email protected]>2014-02-25 19:05:01 -0500
commitd55b2a9d18f1e92ebe1e70b3b3e49ed3a6a872b8 (patch)
tree8453f27a82476dc8648d0d720aae8f1235d41c81
parentc6cafdd402b395edadc6194a77889d84814e5f92 (diff)
Fixed up Grid and Space() documentation.
-rw-r--r--grid.go2
-rw-r--r--stack.go8
2 files changed, 8 insertions, 2 deletions
diff --git a/grid.go b/grid.go
index 1cea202..78d1f2e 100644
--- a/grid.go
+++ b/grid.go
@@ -9,7 +9,9 @@ import (
// A Grid arranges Controls in a two-dimensional grid.
// All Controls in a Grid maintain their preferred sizes.
// The height of each row and the width of each column is the maximum preferred height and width (respectively) of all the controls in that row or column (respectively).
+// Controls are aligned to the top left corner of each cell.
// Unlike other UI toolkit Grids, this Grid does not (yet?) allow Controls to span multiple rows or columns.
+// TODO differnet row/column control alignment; stretchy controls or other resizing options
type Grid struct {
lock sync.Mutex
created bool
diff --git a/stack.go b/stack.go
index c01e9bd..269bee4 100644
--- a/stack.go
+++ b/stack.go
@@ -164,8 +164,12 @@ func (s *Stack) preferredSize() (width int, height int, err error) {
return
}
-// Space returns a null control intended for padding layouts with blank space where otherwise impossible (for instance, at the beginning or in the middle of a Stack).
-// In order for a Space to work, it must be marked as stretchy in its parent layout; otherwise its size is undefined.
+// Space returns a null control intended for padding layouts with blank space.
+// It appears to its owner as a control of 0x0 size.
+//
+// For a Stack, Space can be used to insert spaces in the beginning or middle of Stacks (Stacks by nature handle spaces at the end themselves). In order for this to work properly, make the Space stretchy.
+//
+// For a Grid, Space can be used to have an empty cell. (TODO stretching/sizing rules)
func Space() Control {
// As above, a Stack with no controls draws nothing and reports no errors; its parent will still size it properly if made stretchy.
return NewStack(Horizontal)