summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-11 19:32:40 -0600
committerJeff Carr <[email protected]>2024-01-11 19:32:40 -0600
commited951e0234d428298bd6b76b07e371ce2ab3cb60 (patch)
tree200c77deef52245e59dc96f591e16843a8125927 /structs.go
parent5f6afb8cf8293f819711ccdf791296edfd7ce7d6 (diff)
var value anyv0.12.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go25
1 files changed, 15 insertions, 10 deletions
diff --git a/structs.go b/structs.go
index b84317d..079cb6f 100644
--- a/structs.go
+++ b/structs.go
@@ -15,7 +15,7 @@ import (
// Native Windows and MacOS toolkits
//
// If that is the case, this code abstracts the concept of
-// windows and makes each window a 'tabs' in a single window.
+// windows and makes each window a 'tab' in a single window.
//
// Reminder from Goals: This is for simple GUI's.
// For example, a "Mouse Control Panel" not the GIMP or blender.
@@ -23,6 +23,17 @@ import (
var me guiConfig
+// Range(1, 10) includes the values 1 and 10
+// almost all toolkits use integers so there doesn't
+// seem to be a good idea to use 'type any' here as it
+// just makes things more complicated for no good reason
+type Range struct {
+ Low int
+ High int
+}
+
+type List []string
+
type guiConfig struct {
initOnce sync.Once
@@ -56,13 +67,12 @@ type Node struct {
WidgetType widget.WidgetType
- // for NewLabel("hello"), Text = 'hello'
- Text string // what is visable to the user
+ // the current widget value.
+ value any
- // for NewLabel("hello"), if Name = 'HELLO'
// this can programatically identify the widget
// The name must be unique
- Name string // a name useful for debugging
+ progname string // a name useful for debugging
// used for Windows in toolkits measured in pixels
width int
@@ -86,11 +96,6 @@ type Node struct {
AtW int
AtH int
- // the current widget value.
- I int
- S string
- B bool
- value any
// this function is run when there are mouse or keyboard events
Custom func()