Go
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
data Update README; add screenshots Feb 25, 2011
declarative DataBinder: Add auto-submit delay Jun 28, 2017
examples DataBinder: Submit zero value if property getter returns nil, except … Apr 25, 2017
l10n Update validators Apr 11, 2017
tools/ui2walk Rename RootWidget to Form Jul 16, 2013
AUTHORS Keep AUTHORS list sorted May 16, 2017
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 ToolTipErrorPresenter Apr 11, 2017
bitmap.go Some Bitmap / WindowBase.Screenshot refactoring Apr 11, 2017
boxlayout.go Some ScrollView improvements Apr 11, 2017
brush.go TabWidget: Fix display glitches that occurred with non-themed app Apr 24, 2017
button.go CheckBox: Add persistence support Mar 7, 2017
cancelevent.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
canvas.go Canvas: Add GradientFillRectangle May 8, 2017
checkbox.go CheckBox: Use GetThemePartSize in MinSizeHint if possible Apr 11, 2017
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 ComboBox: Fix using wrong changed event for Value property Jun 13, 2017
commondialogs.go FileDialog: Fix usage of InitialDirPath for ShowBrowseFolder, closes #… Aug 1, 2016
composite.go Expose NewCompositeWithStyle Apr 11, 2017
condition.go Use govaluate package to enable much more powerful expressions Feb 27, 2017
container.go First steps towards support for transparent TabWidgets Apr 16, 2017
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 DataBinder: Add auto-submit delay Jun 28, 2017
dateedit.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
dialog.go Fix glitch where the initially focused LineEdit would scroll part of … Apr 11, 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 a simple layout scheduling system to avoid pointless intermediate… Apr 11, 2017
expression.go Import govaluate dependency directly in walk package Mar 23, 2017
font.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
form.go FormBase: Skip RadioButtons when searching for a widget to focus on s… Jun 13, 2017
gradientcomposite.go GradientComposite: Use Canvas.GradientFillRectangle May 8, 2017
gridlayout.go Some ScrollView improvements Apr 11, 2017
groupbox.go GroupBox: Remove accidentally committed code May 17, 2017
icon.go make it possible to create an icon from an existing HICON May 12, 2017
image.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
imagelist.go Fix image list creation regression Feb 28, 2017
imageview.go ImageView: We clear the background ourselves Mar 8, 2017
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 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 Expose NewCompositeWithStyle Apr 11, 2017
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 Add CellStyler and CellStyle Mar 14, 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 Fix loading bitmap from resource Mar 9, 2017
scrollview.go Some ScrollView improvements Apr 11, 2017
separator.go Add Separator widget Mar 23, 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 persistence support Mar 7, 2017
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: Improve splitter handle visibility during dragging Mar 23, 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 handle statusbar click events Apr 5, 2017
tableview.go TableView: Fix some persistence problems May 17, 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 TabPage: Add Image property Apr 17, 2017
tabpagelist.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tabwidget.go TabWidget: Fix display glitches that occurred with non-themed app Apr 24, 2017
textedit.go TextEdit: Publish TextChanged event if text was changed via SetText May 17, 2017
toolbar.go ToolBar: Invalidate on some events Apr 11, 2017
toolbutton.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
tooltip.go Add ToolTipErrorPresenter Apr 11, 2017
tooltiperrorpresenter.go Add missing license header to tooltiperrorpresenter.go Jun 28, 2017
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 Some layout improvements Mar 23, 2017
validators.go Update validators Apr 11, 2017
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 WebView: Workaround for invisible document glitch May 2, 2017
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: Fix bug in updateParentLayout that prevented scheduling o… May 8, 2017
widgetlist.go Add build tags to allow this library to be included in a cross platfo… Sep 15, 2015
window.go Fix background handling for disabled editable ComboBox Apr 11, 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.