Go
Permalink
Failed to load latest commit information.
data Update README; add screenshots Feb 25, 2011
declarative Use govaluate package to enable much more powerful expressions Feb 27, 2017
examples Use some new stuff in webview example Feb 27, 2017
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 Update minimum Go version note in README Feb 23, 2017
action.go Action: Don't rely on conditions in Enabled and Visible, which could … Feb 9, 2017
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 Bitmap: Add support for loading from resource Feb 27, 2017
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 Button: Add Image property Feb 27, 2017
cancelevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
canvas.go Canvas: Expose HDC Jan 24, 2017
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 Use govaluate package to enable much more powerful expressions Feb 27, 2017
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 Move disabling of owner before running message loop from Dialog to Fo… Feb 27, 2017
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
expression.go Use govaluate package to enable much more powerful expressions Feb 27, 2017
font.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
form.go FormBase: Add Icon property + some property stuff in related declarat… Feb 27, 2017
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 Icon: Refactor loading from resource Feb 27, 2017
image.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
imagelist.go Add support for populating image lists from resource manager Feb 27, 2017
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
intrangeevent.go TableModel/TableView: Add support for adding and removing ranges of i… Feb 27, 2017
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 Add more properties to some widgets Feb 27, 2017
mainwindow.go TableView: Don't display focus rectangle Jan 24, 2017
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 TableModel/TableView: Add support for adding and removing ranges of i… Feb 27, 2017
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 Use govaluate package to enable much more powerful expressions Feb 27, 2017
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
resourcemanager.go Add ResourceManager Feb 27, 2017
scrollview.go ScrollView: Add support for specifying scrollable axes Jan 24, 2017
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 Splitter: Use sizes instead of fractions and add support for fixed si… Jan 24, 2017
splitterhandle.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
splitterlayout.go Splitter: Use sizes instead of fractions and add support for fixed si… Jan 24, 2017
statusbar.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tableview.go Add more properties to some widgets Feb 27, 2017
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 ToolBar: Improve sizing Jan 24, 2017
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 more properties to some widgets Feb 27, 2017
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 Button: Add Image property Feb 27, 2017
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 WidgetBase: Add SetMinMaxSize Jan 24, 2017
widgetlist.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
window.go Use pre-existing window handle in InitWindow Feb 27, 2017

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">
        <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.