{"id":13413139,"url":"https://github.com/lxn/walk","last_synced_at":"2025-05-13T18:12:42.345Z","repository":{"id":1073534,"uuid":"914796","full_name":"lxn/walk","owner":"lxn","description":"A Windows GUI toolkit for the Go Programming Language","archived":false,"fork":false,"pushed_at":"2024-01-21T11:56:29.000Z","size":5450,"stargazers_count":6969,"open_issues_count":346,"forks_count":901,"subscribers_count":256,"default_branch":"master","last_synced_at":"2025-04-25T17:54:54.448Z","etag":null,"topics":["declarative","declarative-ui","go","gui","gui-toolkit","win32","windows","windows-desktop"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lxn.png","metadata":{"files":{"readme":"README.mdown","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-09-16T08:11:49.000Z","updated_at":"2025-04-23T12:08:24.000Z","dependencies_parsed_at":"2022-07-14T08:08:50.072Z","dependency_job_id":"c471b3d0-2839-4820-81cf-2d247201f618","html_url":"https://github.com/lxn/walk","commit_stats":{"total_commits":1477,"total_committers":40,"mean_commits":36.925,"dds":0.5937711577522005,"last_synced_commit":"c389da54e794a411ec9c9bfda01f2a0eb1b5a9b4"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxn%2Fwalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxn%2Fwalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxn%2Fwalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxn%2Fwalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lxn","download_url":"https://codeload.github.com/lxn/walk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000883,"owners_count":21997443,"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":["declarative","declarative-ui","go","gui","gui-toolkit","win32","windows","windows-desktop"],"created_at":"2024-07-30T20:01:34.002Z","updated_at":"2025-05-13T18:12:42.321Z","avatar_url":"https://github.com/lxn.png","language":"Go","readme":"About Walk\n==========\n\nWalk is a \"Windows Application Library Kit\" for the Go Programming Language.\n\nIts primarily useful for Desktop GUI development, but there is some more stuff.\n\nSetup\n=====\n\nMake sure you have a working Go installation.\nSee [Getting Started](http://golang.org/doc/install.html)\n\n##### Note\nWalk currently requires Go 1.11.x or later.\n\n##### To Install\nNow run `go get github.com/lxn/walk`\n\nUsing Walk\n==========\n\nThe preferred way to create GUIs with Walk is to use its declarative sub package,\nas illustrated in this small example:\n\n##### `test.go`\n\n```go\npackage main\n\nimport (\n\t\"github.com/lxn/walk\"\n\t. \"github.com/lxn/walk/declarative\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar inTE, outTE *walk.TextEdit\n\n\tMainWindow{\n\t\tTitle:   \"SCREAMO\",\n\t\tMinSize: Size{600, 400},\n\t\tLayout:  VBox{},\n\t\tChildren: []Widget{\n\t\t\tHSplitter{\n\t\t\t\tChildren: []Widget{\n\t\t\t\t\tTextEdit{AssignTo: \u0026inTE},\n\t\t\t\t\tTextEdit{AssignTo: \u0026outTE, ReadOnly: true},\n\t\t\t\t},\n\t\t\t},\n\t\t\tPushButton{\n\t\t\t\tText: \"SCREAM\",\n\t\t\t\tOnClicked: func() {\n\t\t\t\t\toutTE.SetText(strings.ToUpper(inTE.Text()))\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}.Run()\n}\n```\n\n##### Create Manifest `test.manifest`\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n\u003cassembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\"\u003e\n    \u003cassemblyIdentity version=\"1.0.0.0\" processorArchitecture=\"*\" name=\"SomeFunkyNameHere\" type=\"win32\"/\u003e\n    \u003cdependency\u003e\n        \u003cdependentAssembly\u003e\n            \u003cassemblyIdentity type=\"win32\" name=\"Microsoft.Windows.Common-Controls\" version=\"6.0.0.0\" processorArchitecture=\"*\" publicKeyToken=\"6595b64144ccf1df\" language=\"*\"/\u003e\n        \u003c/dependentAssembly\u003e\n    \u003c/dependency\u003e\n    \u003capplication xmlns=\"urn:schemas-microsoft-com:asm.v3\"\u003e\n        \u003cwindowsSettings\u003e\n            \u003cdpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\"\u003ePerMonitorV2, PerMonitor\u003c/dpiAwareness\u003e\n            \u003cdpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\"\u003eTrue\u003c/dpiAware\u003e\n        \u003c/windowsSettings\u003e\n    \u003c/application\u003e\n\u003c/assembly\u003e\n```\n\nThen either compile the manifest using the [rsrc tool](https://github.com/akavel/rsrc), like this:\n\n\tgo get github.com/akavel/rsrc\n\trsrc -manifest test.manifest -o rsrc.syso\n\nor rename the `test.manifest` file to `test.exe.manifest` and distribute it with the application instead.\n\n##### Build app\n\nIn the directory containing `test.go` run\n\n\tgo build\n\t\nTo get rid of the cmd window, instead run\n\n\tgo build -ldflags=\"-H windowsgui\"\n\n##### Run app\n\t\n\ttest.exe\n\t\n##### Sample Output (Windows 7)\n\n![alt tag](http://i.imgur.com/lUrgE2Q.png)\n\n##### More Examples\nThere are some [examples](examples) that should get you started.\n\nApplication Manifest Files\n==========================\nWalk requires Common Controls 6. This means that you must put an appropriate\napplication manifest file either next to your executable or embedded as a\nresource.\n\nYou can copy one of the application manifest files that come with the examples.\n\nTo embed a manifest file as a resource, you can use the [rsrc tool](https://github.com/akavel/rsrc).\n\nIMPORTANT: If you don't embed a manifest as a resource, then you should not launch\nyour executable before the manifest file is in place.\nIf you do anyway, the program will not run properly. And worse, Windows will not\nrecognize a manifest file, you later drop next to the executable. To fix this,\nrebuild your executable and only launch it with a manifest file in place.\n\nCGo Optimizations\n=================\n\nThe usual default message loop includes calls to win32 API functions, which incurs a decent amount\nof runtime overhead coming from Go. As an alternative to this, you may compile Walk using an\noptional C implementation of the main message loop, by passing the `walk_use_cgo` build tag:\n\n   go build -tags walk_use_cgo\n","funding_links":[],"categories":["GUI","Misc","开源类库","Open source library","Go","Relational Databases","Repositories","\u003cspan id=\"gui\"\u003eGUI\u003c/span\u003e"],"sub_categories":["SQL 查询语句构建库","桌面开发","Search and Analytic Databases","高級控制台界面","Advanced Console UIs","Desktop Development","检索及分析资料库","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flxn%2Fwalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flxn%2Fwalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flxn%2Fwalk/lists"}