logo       

Re: [ex11] use of Display: msg#00282

lang.erlang.general

Subject: Re: [ex11] use of Display

From: "Joe Armstrong" <joe@xxxxxxx>
> > If I run something like
> > Display=sw:start("3.1"),
> > Win = swTopLevel:make(Display, 160, 50, 16#ffffcc),
> > Win2 = swTopLevel:make(Display, 260, 50, 16#ffffcc),
> > then closing any of the windows will close both of them.
>
> This is how X works I was rather surprised by this.
>
> The X server seems to assume that one window = one socket connection. Kill
the
> window by clicking on the window destoy button
> then all top level windows die. That's why you'll only ever see one top
> level window created in my code.

Then maybe the ex11_connection could be hidden behind the
swTopLevel:make(...) call? At least for the most common case. If the
connections aren't shared, then they don't fill any function in the
interface, just add entropy.

The Display can be saved in the top-level's state, and if needed retrieved
from there.

What do you think?
regards,
Vlad



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise