[erlang-questions 45] wxWidgets draft/stub tutorial available

Michael Turner <>
Sun Mar 27 09:24:00 CEST 2011

I've thrown together the beginnings of a tutorial for wxWidgets in Erlang.


My goal is not just to give wx newbies a running start.  I'm also exploring
a Tcl/Tk style of desktop app building in Erlang.

However, the Erlang shell, wx's rather slavish mimicking of the wxWidgets
C++ API, and the process architecture of wx as an "application" have all
hindered me somewhat, for the "build simple GUIs mostly from the command
line" goal.

For example, there's no way to define macros in the Erlang shell, much less
a way to read macro definitions from a header file; and wx relies heavily on
macro definitions.  Making the reader look up the macro values in the
headers and supply them as "magic numbers" in the Erlang shell feels
distinctly sub-optimal.

As well, wx graphics runs in its own process.  To add callbacks defined as
funs from the command line seems awkward across the IPC barrier for all but
the simplest callbacks -- though of course it's a cool thing about Erlang
that you can do this at all.

There might be easier ways than I can currently imagine for reaching the
goals of this tutorial.  For example, the next "chapter" (or two) might to
take the reader through the process of building a GUI for a kind of
specialized mini-shell that "knows" (from parsing the wx header file(s)) the
wx macro definitions -- though I must admit I've only begun to think about
how it might work.  In part because Erlang/OTP contains excellent parsing
tools for Erlang itself, adding this kind of thing is much easier than in
some other programming languages.

In any case, feedback is very welcome.  I'm curious about the level of
interest out there in any continuing work on this tutorial, since the
current draft could potentially be the first of a dozen of more chapters --
wxWidgets is a big topic.  If I hear from even a handful of people who
worked through this draft and found themselves thirsty for more, that's
enough of an audience for me.

The repo is here:


-michael turner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110327/f70769cd/attachment.html>

More information about the erlang-questions mailing list