A Windows GUI toolkit for the Go Programming Language
Go
Permalink
Failed to load latest commit information.
data Update README; add screenshots Feb 25, 2011
declarative declarative/SplitButton: Fix copyright date Aug 1, 2016
examples Add negated condition Aug 1, 2016
l10n Add support for providing translated strings Oct 21, 2012
tools/ui2walk Rename RootWidget to Form Jul 16, 2013
AUTHORS Clean up dropfiles api Dec 6, 2015
LICENSE Initial commit \o/ Sep 16, 2010
README.mdown Merge branch 'master' of github.com:lxn/walk Dec 10, 2013
action.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
actionlist.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
application.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
bitmap.go add screenshot api Mar 13, 2016
boxlayout.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
brush.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
button.go Add SplitButton Aug 1, 2016
cancelevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
canvas.go add polyline Mar 3, 2016
checkbox.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
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 Suppress text selection for editable ComboBox on resize; go fmt Aug 1, 2016
commondialogs.go FileDialog: Fix usage of InitialDirPath for ShowBrowseFolder, closes #… Aug 1, 2016
composite.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
condition.go Add negated condition Aug 1, 2016
container.go handle slider messages Jan 12, 2016
cursor.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
customwidget.go add screenshot api Mar 13, 2016
databinding.go DataBinding: add new DataField interface Dec 5, 2015
dateedit.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
dialog.go dialog: avoid dialog hanging off screen when possible Aug 8, 2016
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 Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
font.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
form.go Fix mouse events Sep 21, 2015
gridlayout.go GridLayout: Avoid gaps when widgets are invisible Aug 1, 2016
groupbox.go GroupBox: Fix SetTitle having no visible effect, fixes #162, thanks C… Oct 15, 2015
icon.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
image.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
imagelist.go ImageList: Expose Handle Aug 1, 2016
imageview.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
inifilesettings.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
intevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
keyboard.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
keyevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
label.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
lineedit.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
lineerrorpresenter.go LineErrorPresenter: Override applyEnabled Nov 16, 2015
listbox.go set listbox default to single selection Dec 19, 2015
mainwindow.go MainWindow: Fix layout with StatusBar #215 Aug 4, 2016
maptablemodel.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
menu.go MainWindow, Menu: Fix menu bar not being redrawn when inserting or re… Jan 11, 2016
messagebox.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
metafile.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
models.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
mouseevent.go To add the mouse wheel event processing for WindowBase Nov 23, 2015
notifyicon.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
numberedit.go NumberEdit: fix tooltips Nov 20, 2015
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 ProgressBar: Add MarqueeMode Nov 12, 2015
progressindicator.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
property.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
pushbutton.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
radiobutton.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
rectangle.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
reflectmodels.go DataBinding: add new DataField interface Dec 5, 2015
registry.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
scrollview.go Fix mouse events Sep 21, 2015
simpletypes.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
size.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
slider.go Slider: Add WS_TABSTOP style Aug 1, 2016
spacer.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
splitbutton.go Add SplitButton Aug 1, 2016
splitter.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
splitterhandle.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
splitterlayout.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
statusbar.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tableview.go TableView: Make single item selection the default (breaking change) Dec 19, 2015
tableviewcolumn.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tableviewcolumnlist.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tabpage.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tabpagelist.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tabwidget.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
textedit.go Sets the max length of an text edit. Nov 17, 2015
toolbar.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
toolbutton.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tooltip.go ToolTip: allow 79 code points, not bytes for text Nov 20, 2015
treeitemevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
treeview.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
util.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
validators.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
walk.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
webview.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
webview_dwebbrowserevents2.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
webview_idochostuihandler.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
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 Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
widgetlist.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
window.go MainWindow: Fix layout with StatusBar #215 Aug 4, 2016

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.0.x doesn't work with walk anymore, Make sure you use Go 1.1.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>
    </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.