All Projects → lxn → Walk

lxn / Walk

Licence: other
A Windows GUI toolkit for the Go Programming Language

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Walk

Wxwidgets
wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls.
Stars: ✭ 3,994 (-31.29%)
Mutual labels:  win32, gui
Phoenix
wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
Stars: ✭ 1,698 (-70.79%)
Mutual labels:  gui, gui-toolkit
Swiftgui
SwiftGUI is an API inspired by SwiftUI DSL, using Dear ImGui as renderer and running on macOS 10.13+ and iOS 11+
Stars: ✭ 74 (-98.73%)
Mutual labels:  gui, declarative-ui
Xmly Downloader Qt5
喜马拉雅FM专辑下载器. 支持VIP与付费专辑. 使用Go+Qt5编写(Not Qt Binding).
Stars: ✭ 214 (-96.32%)
Mutual labels:  win32, gui
Script Reset Windows Update Tool
This script reset the Windows Update Components.
Stars: ✭ 68 (-98.83%)
Mutual labels:  windows-desktop, win32
Govcl
Cross-platform Golang GUI library.
Stars: ✭ 953 (-83.61%)
Mutual labels:  windows-desktop, gui
Xtd forms
Modern c++17 library to create native gui for Microsoft Windows, Apple macOS and Linux.
Stars: ✭ 25 (-99.57%)
Mutual labels:  win32, gui
Win32 Programming
Win32编程
Stars: ✭ 151 (-97.4%)
Mutual labels:  windows-desktop, win32
Compose Jb
Jetpack Compose for Desktop and Web, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
Stars: ✭ 7,562 (+30.09%)
Mutual labels:  gui, declarative-ui
Vis Ui
libGDX UI toolkit
Stars: ✭ 547 (-90.59%)
Mutual labels:  gui
Gui.cs
Console-based user interface toolkit for .NET applications.
Stars: ✭ 5,879 (+1.14%)
Mutual labels:  gui
Darkui
Dark themed control and docking library for .NET WinForms.
Stars: ✭ 539 (-90.73%)
Mutual labels:  windows-desktop
Layout
Single-file library for calculating 2D UI layouts using stacking boxes. Compiles as C99 or C++.
Stars: ✭ 551 (-90.52%)
Mutual labels:  gui
Sauron Native
Truly cross platform, truly native. multiple backend GUI for rust
Stars: ✭ 587 (-89.9%)
Mutual labels:  gui
Persepolis
Persepolis Download Manager is a GUI for aria2.
Stars: ✭ 5,218 (-10.24%)
Mutual labels:  gui
Imgui Sfml
Dear ImGui binding for use with SFML
Stars: ✭ 596 (-89.75%)
Mutual labels:  gui
Dynamodb Gui Client
DynamoDb GUI Client
Stars: ✭ 540 (-90.71%)
Mutual labels:  gui
Macroid
A modular functional UI language for Android
Stars: ✭ 537 (-90.76%)
Mutual labels:  gui
Sigma coding youtube
This is a collection of all the code that can be found on my YouTube channel Sigma Coding.
Stars: ✭ 611 (-89.49%)
Mutual labels:  win32
Imgui markdown
Markdown for Dear ImGui
Stars: ✭ 594 (-89.78%)
Mutual labels:  gui

About Walk

Walk is a "Windows Application Library Kit" for the Go Programming Language.

Its primarily useful for Desktop GUI development, but there is some more stuff.

Setup

Make sure you have a working Go installation. See Getting Started

Note

Walk currently requires Go 1.11.x or later.

To Install

Now run go get github.com/lxn/walk

Using Walk

The preferred way to create GUIs with Walk is to use its declarative sub package, as illustrated in this small example:

test.go
package main

import (
	"github.com/lxn/walk"
	. "github.com/lxn/walk/declarative"
	"strings"
)

func main() {
	var inTE, outTE *walk.TextEdit

	MainWindow{
		Title:   "SCREAMO",
		MinSize: Size{600, 400},
		Layout:  VBox{},
		Children: []Widget{
			HSplitter{
				Children: []Widget{
					TextEdit{AssignTo: &inTE},
					TextEdit{AssignTo: &outTE, ReadOnly: true},
				},
			},
			PushButton{
				Text: "SCREAM",
				OnClicked: func() {
					outTE.SetText(strings.ToUpper(inTE.Text()))
				},
			},
		},
	}.Run()
}
Create Manifest test.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="SomeFunkyNameHere" type="win32"/>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
        </dependentAssembly>
    </dependency>
    <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <windowsSettings>
            <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
            <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True</dpiAware>
        </windowsSettings>
    </application>
</assembly>

Then either compile the manifest using the rsrc tool, like this:

go get github.com/akavel/rsrc
rsrc -manifest test.manifest -o rsrc.syso

or rename the test.manifest file to test.exe.manifest and distribute it with the application instead.

Build app

In the directory containing test.go run

go build

To get rid of the cmd window, instead run

go build -ldflags="-H windowsgui"
Run app
test.exe
Sample Output (Windows 7)

alt tag

More Examples

There are some examples that should get you started.

Application Manifest Files

Walk requires Common Controls 6. This means that you must put an appropriate application manifest file either next to your executable or embedded as a resource.

You can copy one of the application manifest files that come with the examples.

To embed a manifest file as a resource, you can use the rsrc tool.

IMPORTANT: If you don't embed a manifest as a resource, then you should not launch your executable before the manifest file is in place. If you do anyway, the program will not run properly. And worse, Windows will not recognize a manifest file, you later drop next to the executable. To fix this, rebuild your executable and only launch it with a manifest file in place.

CGo Optimizations

The usual default message loop includes calls to win32 API functions, which incurs a decent amount of runtime overhead coming from Go. As an alternative to this, you may compile Walk using an optional C implementation of the main message loop, by passing the walk_use_cgo build tag:

go build -tags walk_use_cgo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].