I've thrown together the beginnings of a tutorial for wxWidgets in Erlang.<div><br></div><div> <a href="http://www.idiom.com/~turner/wxtut/wxwidgets.html">http://www.idiom.com/~turner/wxtut/wxwidgets.html</a><br><div>
<br></div><div>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.</div><div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>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. </div>
<div><br></div><div>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.</div>
<div><br></div><div>The repo is here:</div><div><br></div><div> <a href="https://github.com/Yakushima/wxtut">https://github.com/Yakushima/wxtut</a></div><div><br></div><div>-michael turner</div><div><br></div></div>