diff options
| author | Jeff Carr <[email protected]> | 2024-01-11 16:41:37 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-11 16:41:37 -0600 |
| commit | bc292d0968f5af3427b4459b855cb709a25776f2 (patch) | |
| tree | 6c5d6924067a302e0f53ec7d8dab5875e5f1d501 /grid.go | |
| parent | ab0d77d388af861a1900537d95bf0a5ad35ede97 (diff) | |
type value any
move the common code here. add docs
Diffstat (limited to 'grid.go')
| -rw-r--r-- | grid.go | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -0,0 +1,41 @@ +package widget + +// This is how grids are handled. On the application side, +// things are mostly handled this way. Web browsers, etc +// +// On the toolkit side, this must be translated into the display +// code. This is particularly complicated with ncurses but once +// done in the toolkits, bears fruit in the application code simplicity + +// NOTE: X numbers horizontally, Y is numbered down. Like in mathematics, EXCEPT Y IS DOWN +// this is the only sensible way. It's way too confusing to use negative numbers for Y. +// This is an attempt to make it simple for people to program against this code, +// then we hide these implementation details in the toolkit plugins + +// Grid numbering examples (H) or (W,H) +// ----------------------- +// -- (1) -- (2) -- (3) -- (X) +// ----------------------- +// +// (Y) +// --------- +// -- (1) -- +// -- (2) -- +// --------- +// +// (X,Y) +// -------------------------------------- +// -- (1,1) -- (2,1) -- (3,1) -- (4,1) -- +// -- (1,2) -- (2,2) -- (3,2) -- -- +// -- (1,3) -- -- (3,3) -- (4,3) -- +// -------------------------------------- + +type GridSize struct { + Width int + Height int +} + +type GridOffset struct { + X int + Y int +} |
