summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-05 12:21:47 -0600
committerJeff Carr <[email protected]>2024-02-05 12:21:47 -0600
commitec4fb6aecb83df430a378d604a52c562084b2265 (patch)
treef0deaf44578bf536a7be2724a4d9d4fc8a5f8ed8
parent2613151b8349a8ba5435e03d90e948443b9a7aa9 (diff)
start working on the docs
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--Makefile24
-rw-r--r--README.md5
-rw-r--r--doc.go69
-rw-r--r--geom.go38
4 files changed, 72 insertions, 64 deletions
diff --git a/Makefile b/Makefile
index 102bea6..3402f85 100644
--- a/Makefile
+++ b/Makefile
@@ -6,22 +6,16 @@ all:
@echo The widgets are things like Windows, Buttons, Labels, etc
@echo
+# Test the README.md & doc.go file
+# this runs pkgsite, the binary that does dev.go.dev
+# go install golang.org/x/pkgsite/cmd/pkgsite@latest
+pkgsite:
+ GO111MODULE= pkgsite
+
+goimports:
+ goimports -w *.go
+
redomod:
rm -f go.*
GO111MODULE= go mod init
GO111MODULE= go mod tidy
-
-# sync repo to the github backup
-# git remote add github [email protected]:wit-go/widget.git
-
-github:
- git push origin master
- git push origin devel
- git push origin --tags
- git push github master
- git push github devel
- git push github --tags
- @echo
- @echo check https://git.wit.org/gui/widget
- @echo check https://github.com/wit-go/widget
- @echo
diff --git a/README.md b/README.md
index 12b5c9f..2959bdd 100644
--- a/README.md
+++ b/README.md
@@ -9,3 +9,8 @@ Principles:
* Widget names should try to match [Wikipedia Graphical widget]
* It's ok to guess. Try to do something sensible.
```
+
+### Links
+
+- [A History of the GUI](https://arstechnica.com/features/2005/05/gui/)
+- [Go Sources](https://go.googlesource.com/go)
diff --git a/doc.go b/doc.go
index 7719a9d..99f99fd 100644
--- a/doc.go
+++ b/doc.go
@@ -1,14 +1,57 @@
-package widget
+/*
+# 2D geometry values
+
+There are lots of issues when supporting multiple toolkit plugin
+geometries. The geometries vary widely especially between the
+graphical displays and the serial console ones. [Graphical Widget](http://en.wikipedia.org/Graphical_Widget)
+
+
+ To simplyfy this, we stick to using the concepts:
+
+ ------------------------------ ^
+ | top | |
+ | | |
+ | left right | height
+ | | |
+ | bottom | |
+ ------------------------------ v
+
+ <----------- width ---------->
+
+This way, width & height are always positive numbers.
-// passes information between the gui package and the toolkit plugins
-//
-// This is the only thing that is passed between the toolkit plugin
-//
-// what names should be used? This is not part of [[Graphical Widget]]
-// Event() seems like a good name.
-// Event is used too much: web dev, cloud, etc
-// I'm using "Action". Maybe it should really be
-// "Interaction" as per wikipedia [[User interface]]
-//
-// TODO: convert this to a protobuf (?)
-//
+The qustion of (top,bottom) & (left,right) becomes problematic.
+
+In almost every toolkit, right > left. However, top & bottom
+vary and a choice can not be made easily. Luckily, we maybe do
+not have to make that decision here and can pass that determination
+to the toolkits. So, we use excusively:
+
+ geom(left, right, top, bottom)
+ size(width, height)
+
+# Orientation
+
+Horizontal means layout widgets like books on a bookshelf
+
+ ---------------------------------
+ | W | W | W | W | W | W | W | W |
+ | i | i | i | i | i | i | i | i |
+ | d | d | d | d | d | d | d | d |
+ | g | g | g | g | g | g | g | g |
+ | e | e | e | e | e | e | e | e |
+ | t | t | t | t | t | t | t | t |
+ ---------------------------------
+
+Vertical means layout widgets like books in a stack
+ ----------
+ | Widget |
+ ----------
+ | Widget |
+ ----------
+ | Widget |
+ ----------
+ | Widget |
+ ----------
+*/
+package widget
diff --git a/geom.go b/geom.go
index 238c417..f76ea34 100644
--- a/geom.go
+++ b/geom.go
@@ -1,37 +1,5 @@
package widget
-/*
- 2D geometry values
-
- There are lots of issues when supporting multiple toolkit plugin
- geometries. The geometries vary widely especially between the
- graphical displays and the serial console ones.
-
- To simplyfy this, we stick to using the concepts:
-
- ------------------------------ ^
- | top | |
- | | |
- | left right | height
- | | |
- | bottom | |
- ------------------------------ v
-
- <----------- width ---------->
-
- This way, width & height are always positive numbers.
-
- The qustion of (top,bottom) & (left,right) becomes problematic.
-
- In almost every toolkit, right > left. However, top & bottom
- vary and a choice can not be made easily. Luckily, we maybe do
- not have to make that decision here and can pass that determination
- to the toolkits. So, we use excusively:
-
- geom(left, right, top, bottom)
- size(width, height)
-*/
-
type Geom struct {
Left any
Right any
@@ -45,8 +13,7 @@ type Size struct {
}
/*
-```go
- Horizontal means layout widgets like books on a bookshelf
+Horizontal means layout widgets like books on a bookshelf
---------------------------------
| W | W | W | W | W | W | W | W |
@@ -57,7 +24,7 @@ type Size struct {
| t | t | t | t | t | t | t | t |
---------------------------------
- Vertical means layout widgets like books in a stack
+Vertical means layout widgets like books in a stack
----------
| Widget |
----------
@@ -67,7 +34,6 @@ type Size struct {
----------
| Widget |
----------
-```
*/
type Orientation int