Cleaned up the scrollbars documentation in the Overview.

This commit is contained in:
Pietro Gagliardi 2014-06-09 22:37:43 -04:00
parent 989ba776b0
commit 37ab5f41a7
3 changed files with 15 additions and 5 deletions

View File

@ -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).

13
doc.go
View File

@ -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

View File

@ -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