[erlang-questions] wXWidgets

zxq9 zxq9@REDACTED
Fri Oct 28 16:16:38 CEST 2016


On 2016年10月28日 金曜日 13:53:45 Joe Armstrong wrote:
> Hello,
> 
> Has anybody made a library of high level abstractions to be
> used on-top of wxWidgets?

Hi, Joe.

I have two tiny libraries that I have been slowly putting my most
common GUI abstractions into.

https://github.com/zxq9/zxWidgets
This is the GUI abstractions -- basically meta-widgets built from wx
parts. Like a yes/no modals that return actual booleans instead of
building one each time from buttons/images/references, and grid
structure boxes with headers and labels you can pass in as two lists
and get the constructed reference back (along with a function for
looping through the results, etc.). It is very basic and still lacks
some of the more interesting things I want to do (like 2D and 3D
paint frames within which abstract widget drawing functions can be
used -- basically taking a page out of game widget libs).

Jumptext [imaginary URL goes here]
This one does i18n, and they work together to refresh the skin,
text strings, manage the text strings, etc. It is still unreleased
because it is in a vague legal status (I wrote it, but do I own it if it
was on contract? etc). I will need the same thing later anyway, so I'll
probably wind up re-writing nearly the same thing again and putting it
up.

The glaring omission is the gen_gui behavior I've yet to include in
zxWidgets. There is a very straightforward pattern I've established
for getting the core wx bits up and running, and passing the unhandled
wx* messages through to a callback module, but I've just not gotten
around to formalizing it as a module yet. Which is silly of me, but
this is all unpaid work. :-(

> The wxWidget library is very low level - and many of the manual pages
> say "see external documentation" and just point into the C++ documentation.
> 
> I took a quick peep at the canvas code in the demo/ex_canvas.erl
> module. Code like this is horrible and I can imagine it to be a
> rather straightford mapping of the equivalent code in C++.
> 
> When programming Erlang what I absolutely don't want to do
> is "pretend I'm writing in C++" then painfully translate this into Erlang.

Yes. This complaint was my exact motivation for starting on zxWidgets.
Unfortunately the project that was paying for that party got put on hold
for a bit, but will probably be revived later.

I *really* want to provide a functional style lib over the 2D and 3D
canvass parts!

-Craig



More information about the erlang-questions mailing list