summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds/gui-demo/Makefile2
-rwxr-xr-xcmds/helloworld/helloworldbin0 -> 3097960 bytes
-rw-r--r--cmds/helloworld/main.go27
-rw-r--r--doc.go25
4 files changed, 45 insertions, 9 deletions
diff --git a/cmds/gui-demo/Makefile b/cmds/gui-demo/Makefile
index 2dbc808..41fdd10 100644
--- a/cmds/gui-demo/Makefile
+++ b/cmds/gui-demo/Makefile
@@ -2,4 +2,4 @@ run: build
./gui-demo
build:
- GO111MODULE="off" go build
+ go build
diff --git a/cmds/helloworld/helloworld b/cmds/helloworld/helloworld
new file mode 100755
index 0000000..cc41f78
--- /dev/null
+++ b/cmds/helloworld/helloworld
Binary files differ
diff --git a/cmds/helloworld/main.go b/cmds/helloworld/main.go
new file mode 100644
index 0000000..1cb1bbd
--- /dev/null
+++ b/cmds/helloworld/main.go
@@ -0,0 +1,27 @@
+// This creates a simple hello world window
+package main
+
+import (
+ "git.wit.org/wit/gui"
+)
+
+func main() {
+ gui.Main(initGUI)
+}
+
+// This initializes the first window
+func initGUI() {
+ gui.Config.Title = "Hello World golang wit/gui Window"
+ gui.Config.Width = 640
+ gui.Config.Height = 480
+ node1 := gui.NewWindow()
+ addDemoTab(node1, "A Simple Tab Demo")
+ addDemoTab(node1, "A Second Tab")
+}
+
+func addDemoTab(n *gui.Node, title string) {
+ newNode := n.AddTab(title, nil)
+
+ groupNode1 := newNode.AddGroup("group 1")
+ groupNode1.AddComboBox("demoCombo2", "more 1", "more 2", "more 3")
+}
diff --git a/doc.go b/doc.go
index 2b324c9..35c6a8f 100644
--- a/doc.go
+++ b/doc.go
@@ -1,7 +1,6 @@
/*
-Package wit/gui implements a abstraction layer for Go visual elements in
-a cross platform way. Right now, this abstraction is built on top of
-the GUI toolkit 'andlabs/ui' which does the cross platform support.
+Package gui implements a abstraction layer for Go visual elements in
+a cross platform way.
A quick overview of the features, some general design guidelines
and principles for how this package should generally work:
@@ -15,9 +14,7 @@ Quick Start
This section demonstrates how to quickly get started with spew. See the
sections below for further details on formatting and configuration options.
-To dump a variable with full newlines, indentation, type, and pointer
-information use Dump, Fdump, or Sdump:
-
+ // This creates a simple hello world window
package main
import (
@@ -30,11 +27,12 @@ information use Dump, Fdump, or Sdump:
// This initializes the first window
func initGUI() {
- gui.Config.Title = "WIT GUI Window 1"
+ gui.Config.Title = "Hello World golang wit/gui Window"
gui.Config.Width = 640
gui.Config.Height = 480
node1 := gui.NewWindow()
addDemoTab(node1, "A Simple Tab Demo")
+ addDemoTab(node1, "A Second Tab")
}
func addDemoTab(n *gui.Node, title string) {
@@ -60,7 +58,12 @@ The following configuration options are available:
* Debug
When 'true' log more output
-GUI Usage
+Toolkit Usage
+
+Right now, this abstraction is built on top of the go package 'andlabs/ui'
+which does the cross platform support.
+The next step is to intent is to allow this to work directly against GTK and QT.
+It should be able to add Fyne, WASM, native macos & windows, android, etc.
Errors
@@ -68,5 +71,11 @@ Since it is possible for custom Stringer/error interfaces to panic, spew
detects them and handles them internally by printing the panic information
inline with the output. Since spew is intended to provide deep pretty printing
capabilities on structures, it intentionally does not return any errors.
+
+Debugging
+
+To dump variables with full newlines, indentation, type, and pointer
+information this uses spew.Dump()
+
*/
package gui