guile-user
[Top][All Lists]
Advanced

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

Re: user interface, asynchronous objects, garbage collection


From: Ludovic Courtès
Subject: Re: user interface, asynchronous objects, garbage collection
Date: Wed, 31 Jan 2007 16:46:11 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Hi,

"Marco Maggi" <address@hidden> writes:

> When writing a Guile-GSL script I code forms like this:
>
> (let* ((x     ...)
>        (y     ...) 
>        (plot  (blt-plot x y ...)))
>    (sleep-or-ask-the-user-when-its-ok-to-go-on))
>
> the GOOPS  proxies are stored  in the LET*  environment, and
> this  prevents the  GC to  collect  them while  the user  is
> taking a look.

Isn't there a GOOPS object representing the Tk "display", the root
window or some such?  If so, I guess user code could look like:

  (window-add-plot! w (blt-plot x y ...))

  ;; `sleep-or-ask-the-user-when-its-ok-to-go-on' is replaced by
  ;; something like this:
  (window-event-loop w)

Then, as long as the window lives, the plots it displays are not GC'd.
And the user is likely to be willing to keep a reference to its window
object since it needs it to run the event loop, for instance.

I hope this is relevant,
Ludovic.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]