ex11, esdl

Joe Armstrong <>
Mon Aug 30 11:28:04 CEST 2004

Re: edsl ex11 etc.

Just my 5 c.

   1) I'm not sure  I've published my latest ex11 - it  has a *lot* of
functionality which I'm  not sure can be bolted on  top of a different
graphics engine.

   2) Towards the end of my hacking ex11 I came to the realisation that
I didn't want, or need, a  complex set of underlying widgets,

   I could actually make do with a very small set of widgets, in fact I
could  do 98%  of  everything I  ever wanted  to  do with  one or  two
widgets, unfortunately these widgets aren't in GTK/QL/FLTK etc. :-)

   IMHO instead  of writing a  *general* graphics package which  can do
anything - I'd like to encourage the development of a small number of
widgets which are easy to use and which has specific properties.

   There are basically 3 widgets I'd like to see, and I have been trying
(without much success) to write them using gtk, fltk etc. so that they
work on windows and linux.

   This is what they do:

   Widget 1) - text display widget

 	Displays a fixed font matrix of characters
 	The characters can have different foreground and background colors

 	The API is something like:

 	Win = mkBox("Courier", 12, 40, 80)

 		(makes a 12 point courier font box 40 rows 80 columns

 	putText(Win, FgC, BgC, X, Y, Str)

 		(puts the text in "Str" at (X,Y) in colors (Fgc, Bgc))

 	register(Win, Pid)

 		send messages to Pid if something happens in Win

 		The messages are

 		{Win, windowKilled}            <- windows was resized
 	        {Win, {resized, Rows, Cols}}   <- window was resized
 		{Win, {mouse, X, Y}}           <- mouse was clicked on X,Y
 		{Win, iconised}                <- window was iconised
 		{Win, {keyboard,Event}}        <- key presses, releases etc.

 	map(Win) remap the window (after iconisation)

     I have implemented this in ex11 - using this widget I have
implemented a filebrowser, a file selector, emacs.

     If you think about it the text widget can be used for a vast number
of different things, here are some examples.

 	editor - emacs (whatever)
 	menu system
 	process bars
 	file selectors
         mc (midnight commander)

     It's also easy to use - the API has only a few simple and easily 
understandable calls.

     Wiget 2 - Canvas widget

 	Like the text widget. You just need calls to create a canvas
    and to draw lines, arc, rectangles, points etc. within the canvas.

     Widget 3 - MDI widget (Multiple document Interface)

 	This is just a container for the Canvas and Text Widget.

     Given these three widgets (which I have implemented in ex11) I can do
98% of everything I'd everything I'd ever wanted to do.

   I've   tried  to  do   this  in   GTK,  FLTK   etc.   but   this  is
complicated. Unfortunately  the GTK/FLTK etc. text  widgets are *high*
complex and act as small  word processors. They don't do the low-level
things I want them to do - and they do a lot of high-level things that
I don't want them to do.

   IMHO I think the functionality should be split along the lines that:

 	a) A widget should just do low-level things
 	   (displaying text at absolute positions given fonts,colors,
 	    positions etc.)
         b) high level things (file selection logic, emacs functionality)
 	   etc should be done in Erlang outside the widget.

    The high and low level should communicate by a simple ad-hock protocol
though a socket (or stdio)

    If somebody can make a portable text widget like my 1) above I can supply
code to turn this into an emacs etc.

    << aside - IMHO GUI programming has become ridiculously complex -
in the good ol' days I used the Borland Graphics Interface and programming
using fixed width fonts in fixed size grids was *really* easy - now with all
the "tool support" it has become far more difficult :-) >>


On Fri, 27 Aug 2004, Vlad Dumitrescu wrote:

> From: "Eric Merritt" <>
>>  Actually, with imput from Dan and Karl I am making use of a gl
>> specific backend that they are working on for wings. It  doesn't yet
>> have  multiple windows, but thats a future item they want. Better yet
>> it should be more stable and robust then the SDL engine.
> Hmm, that sounds interesting! And it's platform independent too?
> After answering your previous mail, I started to look at adding SDL_ttf
> support to esdl, which doesn't seem too difficult, thanks to the nice design
> that Dan made. Now I don't know if it's going to be worth it, is something
> else is coming reasonably soon.
> Could Dan or anyone comment? Can this new backend be made available?
> /Vlad

More information about the erlang-questions mailing list