summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/process.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-23 12:35:12 -0500
committerJeff Carr <[email protected]>2023-03-23 12:35:12 -0500
commitd4787a1ebdd08359746516dbb72f1feaf95be5b6 (patch)
treecb81756d61096ccf74af7c8cc9a15e4e00fe1da7 /toolkit/andlabs/process.go
parent6a848bf40474365cc1c0b4da9e2f7e3e10b4d627 (diff)
Squashed commit of the following:v0.7.3
boxes now exist and are tracked in the binary tree create for group and grid works gocui plugin no longer works. TODO: fix in next release converted everything from plugin to Action() can remove send() tab and window are now action() flags moved to action() ready for new release pad() margion() border() all work move worked! go.wit.com attept 578th try adds an early grid widget. won't work until chan andlabs/ui grid (X,Y) works right actually can put things in places in a grid Queue() means shit doesn't look right on grids lots of fucking around. why am I wasting time on image? wow. the crazy doAppend() thing is gone implement Action Show() and Hide() Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/process.go')
-rw-r--r--toolkit/andlabs/process.go72
1 files changed, 72 insertions, 0 deletions
diff --git a/toolkit/andlabs/process.go b/toolkit/andlabs/process.go
new file mode 100644
index 0000000..d70877e
--- /dev/null
+++ b/toolkit/andlabs/process.go
@@ -0,0 +1,72 @@
+// myplugin/myplugin.go
+package main
+
+/*
+from chatgpt:
+
+// put this in widget.go
+import (
+ "fmt"
+ // "toolkit"
+)
+
+type Plugin interface {
+ Process(input chan string, output chan string)
+}
+
+// put this in wit/gui/toolkit/*
+type myPlugin struct{}
+
+var Plugin myPlugin
+
+func (p *myPlugin) Process(input chan string, output chan string) {
+ go func() {
+ for msg := range input {
+ // Your processing logic goes here
+ result := fmt.Sprintf("Processed: %s", msg)
+ output <- result
+ }
+ }()
+}
+
+// main.go put this in wit/gui
+package main
+
+import (
+ "fmt"
+ "plugin"
+ "pluginapi"
+)
+
+func main() {
+ plug, err := plugin.Open("myplugin.so")
+ if err != nil {
+ panic(err)
+ }
+
+ symPlugin, err := plug.Lookup("Plugin")
+ if err != nil {
+ panic(err)
+ }
+
+ p, ok := symPlugin.(pluginapi.Plugin)
+ if !ok {
+ panic("Invalid plugin type")
+ }
+
+ input := make(chan string)
+ output := make(chan string)
+
+ p.Process(input, output)
+
+ input <- "Hello, World!"
+ close(input)
+
+ for result := range output {
+ fmt.Println(result)
+ }
+}
+
+*/
+
+// func main() {}