CLIM mail archive

[Prev][Next][Index][Thread]

Re: forcing pane creation in CLIM 2.0?



>From: Scott McKay <swm@harlequin.com>
>Date: Fri, 15 Jul 94 16:00:59 EDT
>Subject: forcing pane creation in CLIM 2.0?
>
>   Date: Fri, 15 Jul 94 15:38:49 EDT
>   From: Jim Sims <sims@scra.org>
>
>   How can I force all the application panes to exist when my application
>   starts? We have lots of ugly code that depends on being able to call
>   get-frame-pane and get the panes back....
>
>The short answer is, you can't.
>In CLIM 2.0, panes don't exist until you use them in the layou.

There's an additional, slightly more subtle problem connected to this: i.e.
not only are the panes not there before they are used in the layout, but
you have no way of telling for sure --from the outside-- whether or not a
pane (or frame) has been created in time-critical situations.  In
particular, code like the following will often fail.
  
    :
   (CREATE-AND-LAUNCH-MY-FRAME)
   (GET-MY-FRAME-AND-DRAW-ON-ITS-PANES)
    :

(In short, there is a synchronicity problem.  There seems to be no way of
telling whether the frame has actually finished creating the frame/panes
out on the X-server.  Any code in the second function that depends on the
panes being there will lose.  Similarly there can be timing problems if the
creation-code and the drawing are trying to access the same data
structures.)

Having faced both these problem in various contexts, the only safe (and
portable) thing that I've found that I can do is to have *EVERYTHING* in
these situations that needs to access to the pane be driven by the
display-function for the pane.

Often, it is not easy to figure out how this can be done, and it typically
involves some very clever (read "convoluted") coding to make it all work.
But it does seem to be robust.

N


Main Index | Thread Index