ANNOUNCE - graphics package

Joe Armstrong <>
Tue Jan 20 13:58:39 CET 2004

On Tue, 20 Jan 2004, Peter-Henry Mander wrote:

> Sounds like two distinct problems, please explain why they're the same (if they are).
> I think Joe's problem is to maintain consistency between what is visible on screen, and what the Erlang data structures contain, i.e. the user kills a window (maybe forcefully) but ex11 isn't aware the window has gone. The windows don't unexpectedly vanish (I hope!)
Not quite. 

Lets suppose an application program creates several top level windows
to do this it opens (say) port 6000 and zaps off commands to the X server.
If the user kills an individual window then X closes the socket
and all windows vanish.

To avoid this I make a new connection for each top level window.

The problem is more in the other direction. The user can only kill
top level windows - not interior windows.

I associate a controlling process with each widget - if there is an error
in that process then I need to remove the window in a clean way
so that it does not effect the other windows. I also need to tidy up after
a window has been deleted and remove any event handlers which were installed
to take care of internal events. 


> Am I correct Joe? I would expect some form of event or notification in this context. My knowledge of X11 is not all that good, so I'm probably babbling.
> The erlang-gtk thing sounds like a garbage collection issue, i.e. how to keep window handles within the reachable memory set. If the window reference is no longer reachable, it get garbage collected and probably destroyed.
> Pete.
> On Tue, 20 Jan 2004 13:23:32 +0200 (EET)
> Taavi Talvik <> wrote:
> > On Tue, 20 Jan 2004, Joe Armstrong wrote:
> > 
> > > > The parent-child-sibling organisation of Xwindow maps neatly into
> > > > processes. If ex11 can become a concurrent set of loosly coupled
> > > > Xwindows mapped as processes, I reckon that designing new widgets will
> > > > become easy enough not to require a huge library if canned widgets
> > > > that we generally see in most windowing environments.
> > 
> > > Yes - this is *exactly* how I'm building things. The only problem is
> > > garbage collecting the windows and graphics context etc when you
> > > kill the windows.
> > 
> > I had similiar problem - garbage collecting destroyed gtk+ widgets,
> > when implementing yet another erlang-gtk+ binding with pipe driver
> > (
> > 

More information about the erlang-questions mailing list