{"id":21502385,"url":"https://github.com/night-codes/frame","last_synced_at":"2025-07-15T22:32:43.660Z","repository":{"id":57503210,"uuid":"85898865","full_name":"night-codes/frame","owner":"night-codes","description":"Frame - simple golang GUI toolkit (WebKitGTK/Cocoa/CEF)","archived":false,"fork":false,"pushed_at":"2023-04-27T00:42:37.000Z","size":2382,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T05:26:42.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/night-codes.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-23T02:40:27.000Z","updated_at":"2024-04-12T05:26:41.000Z","dependencies_parsed_at":"2024-06-20T04:42:49.454Z","dependency_job_id":"a2d45264-efd2-4427-ac52-a730a171a9ba","html_url":"https://github.com/night-codes/frame","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-codes%2Fframe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-codes%2Fframe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-codes%2Fframe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-codes%2Fframe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/night-codes","download_url":"https://codeload.github.com/night-codes/frame/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226077479,"owners_count":17570164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-23T18:14:43.927Z","updated_at":"2024-11-23T18:14:44.549Z","avatar_url":"https://github.com/night-codes.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frame - simple golang GUI toolkit (WebKitGTK/cocoa/CEF)\n## Install\n\n`go get github.com/night-codes/frame`\n\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/night-codes/frame\"\n)\n\nfunc main() {\n\tapp := frame.MakeApp(\"My App\") // please, use this row as first in main func\n\tapp.SetIconFromFile(\"./moon.png\")\n\n\twindow := app.NewWindow(\"Simple program!\", 450, 300).\n\t\tLoadHTML(`\u003cbody style=\"color:#dddddd; background: transparent\"\u003e\n\t\t\t\t\t\u003ch1\u003eHello world\u003c/h1\u003e\n\t\t\t\t\t\u003cp\u003eTest test test...\u003c/p\u003e\n\t\t\t\t\u003c/body\u003e`, \"about:blank\").\n\t\tSetBackgroundColor(50, 50, 50, 0.9)\n\n\tgo func() {\n\t\twindow.Show() // show window asynchronously from another go routine\n\n\t\t// You don't have to worry about high resolution screens,\n\t\t// the app will look equally good on all screens.\n\t\tfmt.Print(\"Window size: \")\n\t\tfmt.Println(window.GetSize()) // Used DPI-related pixels as in browser\n\t\tfmt.Print(\"Window inner size: \")\n\t\tfmt.Println(window.GetInnerSize())\n\t}()\n\n\tgo func() { // Yes! You can change everything in another threads!\n\t\ttime.Sleep(time.Second * 5)\n\n\t\twindow.SetCenter().\n\t\t\tKeepAbove(true).\n\t\t\tSetSize(900, 600).\n\t\t\tLoad(\"https://html5test.com/\")\n\n\t\tfmt.Print(\"Screen size: \")\n\t\tfmt.Println(window.GetScreenSize()) // Used DPI-related pixels as in browser\n\n\t\ttime.Sleep(time.Second * 15)\n\t\twindow.Hide() // will close window and finish application after 15 second\n\t}()\n\n\tapp.WaitAllWindowClose() // lock main to avoid app termination (you can also use your own way)\n}\n\n```\n\n## Building example:\nTo build the app use the following commands:\n\n### Macos\n```bash\n$ mkdir -p Example.app/Contents/MacOS\n$ go build -o Example.app/Contents/MacOS/example\n$ open example.app # Or click on the app in Finder\n```\n\n### Linux\n```bash\nsudo apt install build-essential\nsudo apt install libwebkit2gtk-4.0-dev\n\ngo build -o example\n./example # run example\n```\n\n### Windows\n * OS requires special linker flags for GUI apps.\n * Before compiling, install TDM-GCC-64 compiler for CGo: http://tdm-gcc.tdragon.net/download\n```bash\ngo build -ldflags=\"-H windowsgui -s -w\" -o example.exe\n```\n\n## Implementation\n\n| Function                         | MacOS (Cocoa)| Linux (WebKitGTK)| Windows (CEF) |\n| -------------------------------- |:------------:|:----------------:|:-------------:|\n| `App.NewWindow`                  |       ✅     |         ✅       |       ✅     |\n| `App.SetIconFromFile`            |       ✅     |         ✅       |              |\n| `App.WaitAllWindowClose`         |       ✅     |         ✅       |       ✅     |\n| `App.WaitWindowClose`            |       ✅     |         ✅       |       ✅     |\n| `Menu.AddSubMenu`                |       ✅     |         ✅       |              |\n| `Menu.AddItem`                   |       ✅     |         ✅       |              |\n| `Menu.AddSeparatorItem`          |       ✅     |         ✅       |              |\n| `Window.Eval`                    |       ✅     |         ✅       |       ✅     |\n| `Window.Fullscreen`              |       ✅     |         ✅       |       ✅     |\n| `Window.GetScreenSize`           |       ✅     |         ✅       |       ✅     |\n| `Window.GetScreenScaleFactor`    |       ✅     |         ✅       |       ✅     |\n| `Window.GetSize`                 |       ✅     |         ✅       |       ✅     |\n| `Window.GetPosition`             |       ✅     |         ✅       |       ✅     |\n| `Window.Hide`                    |       ✅     |         ✅       |       ✅     |\n| `Window.Iconify`                 |       ✅     |         ✅       |       ✅     |\n| `Window.KeepAbove`               |       ✅     |         ✅       |       ✅     |\n| `Window.KeepBelow`               |       ✅     |         ✅       |              |\n| `Window.Load`                    |       ✅     |         ✅       |       ✅     |\n| `Window.LoadHTML`                |       ✅     |         ✅       |       ✅     |\n| `Window.Maximize`                |       ✅     |         ✅       |       ✅     |\n| `Window.Move`                    |       ✅     |         ✅       |       ✅     |\n| `Window.SetCenter`               |       ✅     |         ✅       |       ✅     |\n| `Window.SetDecorated`            |       ✅     |         ✅       |       ✅     |\n| `Window.SetDeletable`            |       ✅     |         ✅       |       ✅     |\n| `Window.SetInvoke`               |       ✅     |         ✅       |       ✅     |\n| `Window.SetMaxSize`              |       ✅     |         ✅       |       ✅     |\n| `Window.SetMinSize`              |       ✅     |         ✅       |       ✅     |\n| `Window.SetModal`                |       ✅     |         ✅       |       ✅     |\n| `Window.SetOpacity`              |       ✅     |         ✅       |       ✅     |\n| `Window.SetResizeble`            |       ✅     |         ✅       |       ✅     |\n| `Window.SetSize`                 |       ✅     |         ✅       |       ✅     |\n| `Window.SetStateEvent`           |       ✅     |         ✅       |       ✅     |\n| `Window.SetTitle`                |       ✅     |         ✅       |       ✅     |\n| `Window.Show`                    |       ✅     |         ✅       |       ✅     |\n| `Window.SkipPager`               |       ✅     |         ✅       |       ✅     |\n| `Window.SkipTaskbar`             |       ✅     |         ✅       |       ✅     |\n| `Window.Stick`                   |       ✅     |         ✅       |              |\n| `Window.UnsetModal`              |       ✅     |         ✅       |       ✅     |\n| `Window.GetInnerSize`            |       ✅     |         🆗       |       ✅     |\n| `Window.SetInnerSize`            |       ✅     |         🆗       |       ✅     |\n| `Window.SetBackgroundColor`      |       ✅     |         ✅       |       🆗     |\n\n\n# License\n\nCopyright 2019-2021, Oleksiy Chechel (alex.mirrr@gmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnight-codes%2Fframe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnight-codes%2Fframe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnight-codes%2Fframe/lists"}