{"id":36807211,"url":"https://github.com/wit-go/gui","last_synced_at":"2026-01-12T13:41:08.858Z","repository":{"id":93057823,"uuid":"595196326","full_name":"wit-go/gui","owner":"wit-go","description":"This is a mirror of the official URL","archived":false,"fork":false,"pushed_at":"2024-01-12T04:58:48.000Z","size":9776,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T21:39:30.531Z","etag":null,"topics":["golang","gui"],"latest_commit_sha":null,"homepage":"https://git.wit.org/wit/gui","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wit-go.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-30T15:44:13.000Z","updated_at":"2024-05-24T08:14:18.000Z","dependencies_parsed_at":"2023-12-20T21:36:18.704Z","dependency_job_id":"e7f1b0e2-4f09-4431-8a56-19b707d87773","html_url":"https://github.com/wit-go/gui","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/wit-go/gui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wit-go%2Fgui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wit-go%2Fgui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wit-go%2Fgui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wit-go%2Fgui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wit-go","download_url":"https://codeload.github.com/wit-go/gui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wit-go%2Fgui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","gui"],"created_at":"2026-01-12T13:41:07.927Z","updated_at":"2026-01-12T13:41:08.723Z","avatar_url":"https://github.com/wit-go.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gui\n\nPackage gui implements a abstraction layer for Go visual elements.\n\nDefinitions:\n\n```go\n* Toolkit: the underlying GUI library (MacOS gui, Windows gui, gtk, qt, etc)\n* Node: A binary tree of all the underlying widgets\n```\n\nPrinciples:\n\n```go\n* Make code using this package simple to use\n* Hide complexity internally here\n* Isolate the GUI toolkit\n* Widget names should try to match [Wikipedia Graphical widget]\n* When in doubt, search upward in the binary tree\n* It's ok to guess. Try to do something sensible.\n```\n\n## Debian Build\n\nThis worked on debian sid (mate-desktop) on 2023/12/03\nI didn't record the dependances needed (gtk-dev)\n\n```go\nexport GO111MODULE=\"off\"\nmake\n```\n\nHello World Example\n\n```go\n// This creates a simple hello world window\npackage main\n\nimport \t(\n\t\"log\"\n\t\"go.wit.com/wit/gui/gui\"\n)\n\nvar myGui *gui.Node // This is your gui object\n\n// go will sit here until the window exits\nfunc main() {\n\tmyGui = gui.Init()\n}\n\n// This initializes the first window and 2 tabs\nfunc helloworld() {\n\twindow := myGui.NewWindow()\n\n\tgroup := window.NewGroup(\"foo bar\")\n\tgroup.NewButton(\"hello\", func() {\n\t\tlog.Println(\"world\")\n\t})\n}\n```\n\nExternal Toolkits\n\n```go\n* andlabs - [https://github.com/andlabs/ui](https://github.com/andlabs/ui)\n* gocui - [https://github.com/awesome-gocui/gocui](https://github.com/awesome-gocui/gocui)\n```\n\nThe next step is to allow this to work against go-gtk and go-qt.\n\nTODO: Add Fyne, WASM, native macos \u0026 windows, android and\nhopefully also things like libSDL, faiface/pixel, slint\n\n## Bugs\n\n\"The author's idea of friendly may differ to that of many other people.\"\n\n-- quote from the minimalistic window manager 'evilwm'\n\n## References\n\nUseful links and other\nexternal things which might be useful\n\n* Wikipedia Graphical widget - [https://en.wikipedia.org/wiki/Graphical_widget](https://en.wikipedia.org/wiki/Graphical_widget)\n* Github mirror - [https://github.com/wit-go/gui](https://github.com/wit-go/gui)\n* Federated git pull - [https://github.com/forgefed/forgefed](https://github.com/forgefed/forgefed)\n* GO Style Guide - [https://google.github.io/styleguide/go/index](https://google.github.io/styleguide/go/index)\n\n```go\n* [Wikipedia Graphical widget]\n* [Github mirror]\n* [Federated git pull]\n* [GO Style Guide]\n```\n\n## Functions\n\n### func [DebugWidgetWindow](/debugWidget.go#L52)\n\n`func DebugWidgetWindow(w *Node)`\n\n### func [DebugWindow](/debugWindow.go#L21)\n\n`func DebugWindow()`\n\nCreates a window helpful for debugging this package\n\n### func [ExampleCatcher](/chan.go#L37)\n\n`func ExampleCatcher(f func())`\n\n### func [Indent](/debug.go#L124)\n\n`func Indent(b bool, a ...interface{})`\n\n### func [SetDebug](/debug.go#L28)\n\n`func SetDebug(s bool)`\n\n### func [SetFlag](/debug.go#L50)\n\n`func SetFlag(s string, b bool)`\n\n### func [ShowDebugValues](/debug.go#L82)\n\n`func ShowDebugValues()`\n\n### func [StandardExit](/main.go#L153)\n\n`func StandardExit()`\n\nThe window is destroyed and the application exits\nTODO: properly exit the plugin since Quit() doesn't do it\n\n### func [Watchdog](/watchdog.go#L16)\n\n`func Watchdog()`\n\nThis program sits here.\nIf you exit here, the whole thing will os.Exit()\nTODO: use Ticker\n\nThis goroutine can be used like a watchdog timer\n\n## Types\n\n### type [GuiArgs](/structs.go#L29)\n\n`type GuiArgs struct { ... }`\n\nThis struct can be used with the go-arg package\n\n#### Variables\n\n```golang\nvar GuiArg GuiArgs\n```\n\n### type [Node](/structs.go#L59)\n\n`type Node struct { ... }`\n\nThe Node is a binary tree. This is how all GUI elements are stored\nsimply the name and the size of whatever GUI element exists\n\n#### func [New](/main.go#L120)\n\n`func New() *Node`\n\nThere should only be one of these per application\nThis is due to restrictions by being cross platform\nsome toolkit's on some operating systems don't support more than one\nKeep things simple. Do the default expected thing whenever possible\n\n### type [Symbol](/plugin.go#L17)\n\n`type Symbol any`\n\n## Sub Packages\n\n* [log](./log)\n\n* [toolkit](./toolkit)\n\n---\nReadme created from Go doc with [goreadme](https://github.com/posener/goreadme)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwit-go%2Fgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwit-go%2Fgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwit-go%2Fgui/lists"}