Announcing Walk, the "Windows Application Library Kit" for Go

2,089 views
Skip to first unread message

Alexander Neumann

unread,
Sep 16, 2010, 12:25:22 PM9/16/10
to golang-nuts
Hi,

Some months ago I started to play around with Go on Windows. By now
this toy project has grown into a multiple kloc thing (most of that
winapi declarations though), that I wanted to share.

I just couldn't come up with a name for it, but this morning it struck
me like a lightning that it shall be called Walk, the "Windows
Application Library Kit".

You can check it out here:
http://github.com/lxn/walk

Right now it requires a helper dll, because callbacks from Windows to
Go code are not yet possible, but hopefully this won't stay that way
for long: http://codereview.appspot.com/1696051/

If you are interested in Windows Desktop development with Go, you may
want to play around with it a bit. But keep in mind that this is
really experimental stuff for now, so please do not rely on it for
production work.

If you feel like contributing to this project, that would be very
welcome, btw :)

Cheers
Alex

brainman

unread,
Sep 16, 2010, 10:08:55 PM9/16/10
to golang-nuts
On Sep 17, 2:25 am, Alexander Neumann <an2...@googlemail.com> wrote:
> Some months ago I started to play around with Go on Windows. By now
> this toy project has grown into a multiple kloc thing (most of that
> winapi declarations though), that I wanted to share.
>

There is a lot of code in there <g>!

But I couldn't build it:

xxx ttt # ./gobuild/gobuild -o alex.exe alex/
drawing.go
Parsing go
file(s)...
Compiling walk/
winapi...
Compiling walk/winapi/
kernel32...
Compiling walk/winapi/
gdi32...
Compiling walk/winapi/
user32...
Compiling walk/
drawing...
Compiling walk/winapi/
comdlg32...
walk/winapi/comdlg32/comdlg32.go:16: can't find import: walk/winapi/
ole32
ERROR: Can't link executable because of compile
errors.

Also, since I don't use gobuild myself, I was really missing
Makefiles. I think they do help a lot in "unix" environment, if
nothing else, but to quickly check that your program builds and tests
work <g>.

Alex

Alexander Neumann

unread,
Sep 17, 2010, 4:40:42 AM9/17/10
to golang-nuts
Sorry about that, it seems I had some old object files left around,
that contained the required things, so I didn't notice the problem. It
should build now.

>
> Also, since I don't use gobuild myself, I was really missing
> Makefiles. I think they do help a lot in "unix" environment, if
> nothing else, but to quickly check that your program builds and tests
> work <g>.

You are right, I will try to include some makefiles soon. If only
there weren't so many directories and files ;)

>
> Alex

Cheers
Alex

brainman

unread,
Sep 17, 2010, 8:37:12 AM9/17/10
to golang-nuts
> ... It
> should build now.
>

It does. But it crashes when I run it:

panic: syscall.LoadLibrary("crutches.dll") failed: The specified
module could not be found.

panic PC=0x2e8fd0
runtime.panic+0xa3 /home/brainman/hg/go/src/pkg/runtime/proc.c:1019
runtime.panic(0x0, 0x2e9000)
walk/winapi.MustLoadLibrary+0x122 /home/brainman/t/walk/winapi/
winapi.go:33
walk/winapi.MustLoadLibrary(0x4896b0, 0x2e0878, 0x55,
0x4896b0)
walk/crutches.init┬╖1+0x2a /home/brainman/t/walk/crutches/crutches.go:
83
walk/crutches.init┬╖1()
walk/crutches.Init┬╖+0x5a /home/brainman/t/walk/crutches/crutches.go:
123
walk/crutches.Init┬╖()
walk/gui.Init┬╖+0x6e /home/brainman/t/walk/gui/widget.go:708
walk/gui.Init┬╖()
main.init+0x46 /home/brainman/t/alex/drawing.go:106
main.init()
mainstart+0x5 /home/brainman/hg/go/src/pkg/runtime/386/asm.s:81
mainstart()
goexit /home/brainman/hg/go/src/pkg/runtime/proc.c:145
goexit()

I take it, It's looking for crutches.dll. I can see C source for it,
but don't know how to build it.

Alex

Alexander Neumann

unread,
Sep 17, 2010, 11:47:54 AM9/17/10
to golang-nuts
A build of crutches.dll that was statically linked against the MinGW
3.4.5 runtime is now included in the crutches directory. Also the
README now has some more instructions on how to build it yourself.

Thanks for trying this, I hope it will work now.

Cheers
Alex

brainman

unread,
Sep 17, 2010, 9:24:11 PM9/17/10
to golang-nuts
> ... I hope it will work now.

It sure does. First Go Windows GUI app I've seen.
Very cool!

Alex

Alexander Neumann

unread,
Sep 18, 2010, 6:59:43 AM9/18/10
to golang-nuts

> It sure does. First Go Windows GUI app I've seen.
> Very cool!

Thanks, and many more thanks for your and the other Windows porters
work, btw.

Cheers
Alex

techabc

unread,
Jun 6, 2012, 4:48:25 AM6/6/12
to golan...@googlegroups.com
It's close to QT, eg ui2walk, i18n, etc.
How can I implement complex UI like visual studio(MDI, dockable widgets, etc.) by use it?

在 2010年9月18日星期六UTC+8下午6时59分43秒,Alexander Neumann写道:

Alexander Neumann

unread,
Jun 6, 2012, 5:36:09 AM6/6/12
to golang-nuts
Old thread back from the dead ;)

On 6 Jun., 10:48, techabc <tech...@gmail.com> wrote:
> It's close to QT, eg ui2walk, i18n, etc.

Yes, Qt was the main inspiration. Widgets and layout system more or
less follow those of Qt, to be able to use the awesome Qt Designer for
walk.

> How can I implement complex UI like visual studio(MDI, dockable widgets,
> etc.) by use it?

I'm afraid it isn't possible to build stuff like that using walk. I
have no plans to implement MDI or dockable widgets myself, but would
gladly accept contributions :)

Gustavo Niemeyer

unread,
Jun 6, 2012, 8:46:28 AM6/6/12
to Alexander Neumann, golang-nuts
On Wed, Jun 6, 2012 at 6:36 AM, Alexander Neumann <an2...@googlemail.com> wrote:
> Old thread back from the dead ;)

Indeed. :-)

How's the project been going?

I notice there aren't many tests there.. have you considered having some?


gustavo @ http://niemeyer.net

Alexander Neumann

unread,
Jun 6, 2012, 11:02:55 AM6/6/12
to Gustavo Niemeyer, golang-nuts
Am 06.06.2012 14:46, schrieb Gustavo Niemeyer:
> On Wed, Jun 6, 2012 at 6:36 AM, Alexander Neumann <an2...@googlemail.com> wrote:
>> Old thread back from the dead ;)
> Indeed. :-)
>
> How's the project been going?
It has been progressing slowly with the ocassional burst of activity now
and then. On a few ocassions however, nice people have been coming forth
and have made contributions, e.g. a ListBox widget some weeks ago.

Most features I have needed for my projects have been implemented at
some point, though there's of course a lot that could be added or
improved. One thing that's especially lacking is documentation. I guess
some kind of tutorial or a bit more sophisticated example application
would be nice to have.
>
> I notice there aren't many tests there.. have you considered having some?
I would even go so far to say there are no tests at all ;)

Yes, I have thought about it, but I'm not sure it will happen. There is
just too much code there to write tests for it all. Maybe tests for the
layout managers would pay off though...
>
> gustavo @ http://niemeyer.net

Gustavo Niemeyer

unread,
Jun 6, 2012, 11:16:23 AM6/6/12
to Alexander Neumann, golang-nuts
On Wed, Jun 6, 2012 at 12:02 PM, Alexander Neumann
<an2...@googlemail.com> wrote:
> It has been progressing slowly with the ocassional burst of activity now and
> then. On a few ocassions however, nice people have been coming forth and
> have made contributions, e.g. a ListBox widget some weeks ago.

Nice, this is a good sign, and happy to see things have been moving
well with the project. Do you know if anyone is using it to push
projects on the server side of things?

> Most features I have needed for my projects have been implemented at some
> point, though there's of course a lot that could be added or improved. One
> thing that's especially lacking is documentation. I guess some kind of
> tutorial or a bit more sophisticated example application would be nice to
> have.

Indeed, I bet people would appreciate that.

> Yes, I have thought about it, but I'm not sure it will happen. There is just
> too much code there to write tests for it all.

The more code you have, the more tests you need, and the more you'll
benefit from that over time if you intend to keep the project working.
I'd probably consider a deal breaker to have no tests on a large
dependency.


gustavo @ http://niemeyer.net

Alexander Neumann

unread,
Jun 6, 2012, 12:05:49 PM6/6/12
to Gustavo Niemeyer, golang-nuts
Am 06.06.2012 17:16, schrieb Gustavo Niemeyer:
> On Wed, Jun 6, 2012 at 12:02 PM, Alexander Neumann
> <an2...@googlemail.com> wrote:
>> It has been progressing slowly with the ocassional burst of activity now and
>> then. On a few ocassions however, nice people have been coming forth and
>> have made contributions, e.g. a ListBox widget some weeks ago.
> Nice, this is a good sign, and happy to see things have been moving
> well with the project. Do you know if anyone is using it to push
> projects on the server side of things?
No idea if anybody besides me is using it for anything serious. Speak up
people :)

My most non-trivial project using walk is an order management
application, that also happens to use go-pgsql and polyglot and is in
production since over a year. Some weeks ago I have been refactoring the
database access from go-pgsql specific apis to database/sql, oh my ;).
If memory serves right, this even revealed a bug or two in the apps
code, where the go-pgsql apis have been too forgiving.
>> Most features I have needed for my projects have been implemented at some
>> point, though there's of course a lot that could be added or improved. One
>> thing that's especially lacking is documentation. I guess some kind of
>> tutorial or a bit more sophisticated example application would be nice to
>> have.
> Indeed, I bet people would appreciate that.
>> Yes, I have thought about it, but I'm not sure it will happen. There is just
>> too much code there to write tests for it all.
> The more code you have, the more tests you need, and the more you'll
> benefit from that over time if you intend to keep the project working.
> I'd probably consider a deal breaker to have no tests on a large
> dependency.
That's certainly true, but to be fair, I should mention that I'm
considering moving most of my attention to web development in the
future. Nothing is decided at this point though.
>
> gustavo @ http://niemeyer.net


Gbr

unread,
Nov 4, 2012, 6:58:33 PM11/4/12
to golan...@googlegroups.com, an2...@googlemail.com


On Wednesday, June 6, 2012 9:05:49 AM UTC-7, Alexander Neumann wrote:
 
No idea if anybody besides me is using it for anything serious. Speak up
people :)

Looking at the declarative form, not sure how to add interact/add functionality to the declared widgets.  Specifically, in the declarative.go example, how would you implement the logview channel (from the logview.go example) so that the TextEdit widget displays the log messages.

Thanks...

Alexander Neumann

unread,
Nov 5, 2012, 7:48:47 AM11/5/12
to golan...@googlegroups.com, an2...@googlemail.com
You would have to put the LogView widget from the example into your project and implement declarative support for it. You can create new and extend existing widgets as well as provide declarative support for them outside of Walk.

caryg...@gmail.com

unread,
Jun 22, 2015, 10:26:33 AM6/22/15
to golan...@googlegroups.com, an2...@googlemail.com
We are going to use this for an image importation tool in Windows, I was very happy to find this package and was able to implement it pretty quickly!

Reply all
Reply to author
Forward
0 new messages