Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Windows GUI toolkit for the Go Programming Language
Go
Branch: master
Failed to load latest commit information.
data Update README; add screenshots
declarative Dialog: Add support for fixed size
examples examples/actions: Use new ToolBar stuff
l10n Add support for providing translated strings
tools/ui2walk Rename RootWidget to Form
AUTHORS Add myself to AUTHORS :)
LICENSE Initial commit \o/
README.mdown Merge branch 'master' of github.com:lxn/walk
action.go Action: Call raiseChanged when setting conditions
actionlist.go Reduce indentation
application.go Use win instead of go-winapi package and import qualified
bitmap.go Use win instead of go-winapi package and import qualified
boxlayout.go Use stable sort everywhere
brush.go Use win instead of go-winapi package and import qualified
button.go CheckBox: Add support for 3-state mode
cancelevent.go Fix recently introduced events bug
canvas.go Use win instead of go-winapi package and import qualified
checkbox.go CheckBox: Add support for 3-state mode
clipboard.go Clipboard: Add ContentsChanged event
closeevent.go Fix recently introduced events bug
color.go Revert directory layout to what we had initially
combobox.go Don't ask...
commondialogs.go FileDialog: Return uintptr from callback, fixes #75
composite.go Reduce widgets footprint a bit by removing unneeded interface fields
condition.go Add Condition interface and some implementations
container.go Improve enabled propagation
cursor.go Use win instead of go-winapi package and import qualified
customwidget.go Use win instead of go-winapi package and import qualified
databinding.go Don't ask...
dateedit.go Don't ask...
dialog.go Dialog: Remove WS_EX_DLGMODALFRAME to fix system menu for fixed size …
error.go Use win instead of go-winapi package and import qualified
errorevent.go Fix recently introduced events bug
event.go Fix recently introduced events bug
font.go Cache and reuse fonts.
form.go FormBase: Fix enabled propagation
gridlayout.go Use stable sort everywhere
groupbox.go GroupBox: Include internal CheckBox in font application
icon.go Don't ask...
image.go Don't ask...
imagelist.go ImageList: Use 32 bit color depth
imageview.go Reduce widgets footprint a bit by removing unneeded interface fields
indexlist.go Revert directory layout to what we had initially
inifilesettings.go Improve widget state persistence
intevent.go Fix recently introduced events bug
keyboard.go Use win instead of go-winapi package and import qualified
keyevent.go Make key codes be of type Key and implement fmt.Stringer for it
label.go Use win instead of go-winapi package and import qualified
lineedit.go LineEdit: Add CaseMode
lineerrorpresenter.go LineErrorPresenter: Fix font propagation
listbox.go ListBox: Add HasCurrentItem property
mainwindow.go Improve font propagation
maptablemodel.go Use stable sort everywhere
menu.go Don't ask...
messagebox.go Use win instead of go-winapi package and import qualified
metafile.go Use win instead of go-winapi package and import qualified
models.go Add interfaces for reflect based models
mouseevent.go Fix recently introduced events bug
notifyicon.go Use win instead of go-winapi package and import qualified
numberedit.go Improve enabled propagation
path.go Use win instead of go-winapi package and import qualified
pen.go Use win instead of go-winapi package and import qualified
point.go Revert directory layout to what we had initially
progressbar.go Use win instead of go-winapi package and import qualified
progressindicator.go Use win instead of go-winapi package and import qualified
property.go Introduce Window and WindowBase as base for all windows
pushbutton.go Don't ask...
radiobutton.go Use win instead of go-winapi package and import qualified
rectangle.go Use win instead of go-winapi package and import qualified
reflectmodels.go Use stable sort everywhere
registry.go Use win instead of go-winapi package and import qualified
scrollview.go ScrollView: Make persistable and usable as drop-in replacement for Co…
simpletypes.go Revert directory layout to what we had initially
size.go Some Splitter and layout improvements
spacer.go Don't ask...
splitter.go Use win instead of go-winapi package and import qualified
splitterhandle.go Use win instead of go-winapi package and import qualified
splitterlayout.go Splitter: Use StretchFactor to calculate initial sizes
statusbar.go Use win instead of go-winapi package and import qualified
tableview.go TreeView: Add ItemActivated event
tableviewcolumn.go Don't ask...
tableviewcolumnlist.go TableViewColumnList: In Insert, only call item.create if the column i…
tabpage.go TabWidget: Add support for tab page image, fixes #74
tabpagelist.go Use win instead of go-winapi package and import qualified
tabwidget.go Improve enabled propagation
textedit.go Use win instead of go-winapi package and import qualified
toolbar.go ToolBar: Add support for button styles
toolbutton.go Don't ask...
tooltip.go ToolTip: Embed WindowBase instead of WidgetBase
treeitemevent.go TreeView: Refactor to a model based design
treeview.go TreeView: Add ItemActivated event
util.go Improve enabled propagation
validators.go Add support for providing translated strings
walk.go TabWidget: Add support for tab page image, fixes #74
webview.go Use win instead of go-winapi package and import qualified
webview_dwebbrowserevents2.go Use win instead of go-winapi package and import qualified
webview_idochostuihandler.go Use syscall.GUID
webview_ioleclientsite.go Use win instead of go-winapi package and import qualified
webview_ioleinplaceframe.go Use win instead of go-winapi package and import qualified
webview_ioleinplacesite.go Use win instead of go-winapi package and import qualified
widget.go Improve font propagation
widgetlist.go Use win instead of go-winapi package and import qualified
window.go LineEdit: Add CaseMode

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.

Something went wrong with that request. Please try again.