Skip to content
A Windows GUI toolkit for the Go Programming Language
Branch: master
Clone or download
Latest commit 182aa2d May 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Update README; add screenshots Feb 25, 2011
declarative Initial DPI awareness support for images and drawing May 14, 2019
examples Update example manifest files for multi monitor hidpi Apr 30, 2019
l10n Update German translation Feb 5, 2018
tools/ui2walk Rename RootWidget to Form Jul 16, 2013
AUTHORS Update AUTHORS file May 2, 2019
LICENSE Initial commit \o/ Sep 16, 2010
README.mdown Manifest: Revert tmpfile manifest loading Feb 25, 2019
action.go Initial DPI awareness support for images and drawing May 14, 2019
actionlist.go actionlist: provide means of attaching shortcuts to windows May 5, 2019
application.go Add ToolTipErrorPresenter Apr 11, 2017
bitmap.go Fixes for DPI aware images May 14, 2019
boxlayout.go Widget[Base]: Add *Pixel variants of MinSize, MaxSize and SetMinMaxSize May 7, 2019
brush.go More work on multi monitor HIDPI May 7, 2019
button.go Initial DPI awareness support for images and drawing May 14, 2019
cancelevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
canvas.go Fixes for DPI aware images May 14, 2019
checkbox.go Initial multi monitor HIDPI support Apr 30, 2019
clipboard.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
closeevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
color.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
combobox.go Initial multi monitor HIDPI support Apr 30, 2019
commondialogs.go FileDialog: Set FilterIndex as selected by user Apr 11, 2019
composite.go ScrollView: Ensure appropriate composite size after insert and remove Mar 25, 2019
condition.go Use govaluate package to enable much more powerful expressions Feb 27, 2017
container.go More work on multi monitor HIDPI May 7, 2019
cursor.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
customwidget.go CustomWidget: Fix SetClearsBackground Oct 10, 2018
databinding.go DataBinder: Some small fixes Feb 25, 2019
dateedit.go Replace newErr with newError Feb 25, 2019
datelabel.go Labels: Let an embedded static control do the painting Dec 6, 2018
dialog.go Widget[Base]: Add *Pixel variants of MinSize, MaxSize and SetMinMaxSize May 7, 2019
dropfilesevent.go Dropfiles: call DragAcceptFiles only once Dec 7, 2015
error.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
errorevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
event.go Fix layout scheduling problem that seems to occur for widgets w/o form Sep 28, 2017
expression.go reflectExpression: Return nil if value is invalid Dec 5, 2018
flowlayout.go More work on multi monitor HIDPI May 7, 2019
font.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
fontresource.go Initial DPI awareness support for images and drawing May 14, 2019
form.go Merge branch 'master' of github.com:lxn/walk May 14, 2019
gradientcomposite.go More work on multi monitor HIDPI May 7, 2019
graphicseffects.go More work on multi monitor HIDPI May 7, 2019
gridlayout.go Widget[Base]: Add *Pixel variants of MinSize, MaxSize and SetMinMaxSize May 7, 2019
groupbox.go More work on multi monitor HIDPI May 7, 2019
icon.go Fixes for DPI aware images May 14, 2019
iconcache.go Initial DPI awareness support for images and drawing May 14, 2019
image.go Fixes for DPI aware images May 14, 2019
imagelist.go Initial DPI awareness support for images and drawing May 14, 2019
imageview.go Initial DPI awareness support for images and drawing May 14, 2019
inifilesettings.go IniFileSettings: Add portable parameter to save in cwd Mar 21, 2017
intevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
intrangeevent.go TableModel/TableView: Add support for adding and removing ranges of i… Feb 27, 2017
keyboard.go Add Alt+Ctrl to modifiers2string, thanks Stephan Verbeeck Mar 18, 2019
keyevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
label.go By default center labels vertically instead of using GrowableVert Feb 28, 2019
lineedit.go Initial multi monitor HIDPI support Apr 30, 2019
lineerrorpresenter.go More work on multi monitor HIDPI May 7, 2019
linklabel.go Replace newErr with newError Feb 25, 2019
listbox.go Missed a file in some previous commit Feb 25, 2019
mainwindow.go Initial DPI awareness support for images and drawing May 14, 2019
maptablemodel.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
menu.go Fixes for DPI aware images May 14, 2019
messagebox.go Add missing MsgBoxStyle constants Apr 11, 2019
metafile.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
models.go Add ItemsInserted + ItemsRemoved to ListModel and support them in Com… Feb 25, 2019
mouseevent.go To add the mouse wheel event processing for WindowBase Nov 23, 2015
notifyicon.go Merge branch 'master' of github.com:lxn/walk May 14, 2019
numberedit.go More work on multi monitor HIDPI May 7, 2019
numberlabel.go Labels: Let an embedded static control do the painting Dec 6, 2018
path.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
pen.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
point.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
progressbar.go More GraphicsEffects changes Nov 21, 2017
progressindicator.go Fix ProgressIndicator May 14, 2019
property.go boolProperty: Accept source of type Expression Feb 25, 2019
pushbutton.go Initial multi monitor HIDPI support Apr 30, 2019
radiobutton.go Initial multi monitor HIDPI support Apr 30, 2019
rectangle.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
reflectmodels.go Add ItemsInserted + ItemsRemoved to ListModel and support them in Com… Feb 25, 2019
registry.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
resourcemanager.go Replace newErr with newError Feb 25, 2019
scrollview.go More work on multi monitor HIDPI May 7, 2019
separator.go Separator: Add Greedy layout flags Dec 5, 2018
simpletypes.go Label reform Dec 5, 2018
size.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
slider.go Slider: Add support for changing line and page size Feb 26, 2019
spacer.go Spacer: Add support for restricting greed locally Feb 26, 2019
splitbutton.go Initial DPI awareness support for images and drawing May 14, 2019
splitter.go More work on multi monitor HIDPI May 7, 2019
splitterhandle.go Nothing to see here. Move on. Feb 25, 2019
splitterlayout.go Widget[Base]: Add *Pixel variants of MinSize, MaxSize and SetMinMaxSize May 7, 2019
static.go More work on multi monitor HIDPI May 7, 2019
statusbar.go Initial DPI awareness support for images and drawing May 14, 2019
stringevent.go rename: OnTitleChanged -> OnDocumentTitleChanged Apr 16, 2018
tableview.go Initial DPI awareness support for images and drawing May 14, 2019
tableviewcolumn.go tableviewcolumn: do DPI conversion in create() too May 7, 2019
tableviewcolumnlist.go TableView: Add support for frozen columns Mar 22, 2018
tabpage.go Initial DPI awareness support for images and drawing May 14, 2019
tabpagelist.go TabPageList: Recalculate layout on addition May 2, 2019
tabwidget.go Merge branch 'master' of github.com:lxn/walk May 14, 2019
textedit.go TextEdit: Add ScrollToCaret, fixes #468 Mar 11, 2019
textlabel.go More work on multi monitor HIDPI May 7, 2019
toolbar.go Initial DPI awareness support for images and drawing May 14, 2019
toolbutton.go More GraphicsEffects changes Nov 21, 2017
tooltip.go More work on multi monitor HIDPI May 7, 2019
tooltiperrorpresenter.go More GraphicsEffects changes Nov 21, 2017
treeitemevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
treeview.go Initial DPI awareness support for images and drawing May 14, 2019
util.go Fixes for DPI aware images May 14, 2019
validators.go No comment Oct 9, 2017
walk.go Button: Add Image property Feb 27, 2017
webview.go More work on multi monitor HIDPI May 7, 2019
webview_dwebbrowserevents2.go More work on multi monitor HIDPI May 7, 2019
webview_events.go (1)CommandStateChange event of DWebBrowser2.Invoke is splitted into 3… Apr 27, 2018
webview_idochostuihandler.go - declarative/webview.go : The fields are sorted alphabetically. Apr 15, 2018
webview_ioleclientsite.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
webview_ioleinplaceframe.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
webview_ioleinplacesite.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
widget.go Widget[Base]: Add *Pixel variants of MinSize, MaxSize and SetMinMaxSize May 7, 2019
widgetlist.go Nothing to see here. Move on. Feb 25, 2019
window.go Initial DPI awareness support for images and drawing May 14, 2019

README.mdown

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

Go 1.7.x doesn't work with walk anymore, Make sure you use Go 1.8.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" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <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>
    <asmv3:application>
        <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
            <dpiAware>true</dpiAware>
        </asmv3:windowsSettings>
    </asmv3: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.

Program Crashes

By default Go uses os threads with small stack sizes of 128KB. If your walk app crashes, it may be due to a stack overflow. Until a better solution is found, you can work around this by adding

import _ "runtime/cgo"

somewhere in your program. If you don't have gcc installed and on your PATH, you can alternatively add -linkmode internal to the -ldflags of your go build command like so:

go build -ldflags="-H windowsgui -linkmode internal"
You can’t perform that action at this time.