From 37ab5f41a7b08f8101f4716a89c90b0b2132e015 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 9 Jun 2014 22:37:43 -0400 Subject: [PATCH] Cleaned up the scrollbars documentation in the Overview. --- area.go | 3 ++- doc.go | 13 +++++++++++-- listbox.go | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/area.go b/area.go index 6558db8..04dfbaf 100644 --- a/area.go +++ b/area.go @@ -11,7 +11,8 @@ import ( ) // Area represents a blank canvas upon which programs may draw anything and receive arbitrary events from the user. -// An Area has an explicit size, represented in pixels, that may be different from the size shown in its Window; Areas have both horizontal and vertical scrollbars that are hidden when not needed. +// An Area has an explicit size, represented in pixels, that may be different from the size shown in its Window. +// For information on scrollbars, see "Scrollbars" in the Overview. // The coordinate system of an Area always has an origin of (0,0) which maps to the top-left corner; all image.Points and image.Rectangles sent across Area's channels conform to this. // The size of an Area must be at least 1x1 (that is, neither its width nor its height may be zero or negative). // For control layout purposes, an Area prefers to be at the size you set it to (so if an Area is not stretchy in its layout, it will ask to have that size). diff --git a/doc.go b/doc.go index 00c4d14..b51bcc2 100644 --- a/doc.go +++ b/doc.go @@ -68,9 +68,18 @@ Package ui does not close these channels, nor does it send multiple values on th Scrollbars -[TODO] +The following Controls have scrolling support built in: + + Listbox * + Area + +All of the above controls have both horizontal and vertical scrollbars. +These scrollbars hide themselves when not needed. + +[FUTURE DISCUSSIONS: scrolling programmatically, MouseEvent/KeyEvent scroll overrides] + +[FUTURE PLAN: Controls that are not marked with a * in the above list can have their scrollbars disabled completely in code.] The result of resizing the window such that the scrollbars consider themselves too small is implementation-defined. - */ package ui diff --git a/listbox.go b/listbox.go index 8245a7b..7ad7adf 100644 --- a/listbox.go +++ b/listbox.go @@ -9,8 +9,8 @@ import ( // A Listbox is a vertical list of items, of which either at most one or any number of items can be selected at any given time. // On creation, no item is selected. -// Listboxes have vertical scrollbars that are hidden when not needed. -// The presence of horizontal scrollbars is currently undefined. +// For information on scrollbars, see "Scrollbars" in the Overview. +// Due to implementation issues, the presence of horizontal scrollbars is currently implementation-defined. type Listbox struct { lock sync.Mutex created bool