From 9dc6e6f7b39e9a3615ce21e2e03f82315038a470 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 7 Mar 2014 19:28:25 -0500 Subject: Pinned (or marked for later pinninig) behavior of various controls; also improved Space()'s documentation. --- stack.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'stack.go') diff --git a/stack.go b/stack.go index 8710594..2e4af36 100644 --- a/stack.go +++ b/stack.go @@ -48,6 +48,7 @@ func NewVerticalStack(controls ...Control) *Stack { } // SetStretchy marks a control in a Stack as stretchy. This cannot be called once the Window containing the Stack has been opened. +// (TODO action on invalid index) func (s *Stack) SetStretchy(index int) { s.lock.Lock() defer s.lock.Unlock() @@ -182,12 +183,12 @@ func (s *Stack) preferredSize() (width int, height int, err error) { return } -// Space returns a null control intended for padding layouts with blank space. -// It appears to its owner as a control of 0x0 size. +// 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) +// For a Grid, Space can be used to have an empty cell. A stretchy Grid cell with a Space can be used to anchor the perimeter of a Grid to the respective Window edges without resizing the other controls (leaving empty space in the Window otherwise). Otherwise, you do not need to do anything special for the Space to work (though remember that an entire row or column of Spaces will appear as having height or width zero, respectively, unless one is marked as stretchy). 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) -- cgit v1.2.3