[ltk-user] ensure-ltk ?

Daniel Herring dherring at tentpost.com
Sat Jan 2 02:45:18 UTC 2010


Hi,

What's the proper idiom when writing a function that might start wish or 
might be called inside another with-ltk?

For example,
(defun some-window ()
   (ensure-ltk ()
     ...))

Where some-window could be called from a REPL or from a tk callback? Is 
there already a way to do this in ltk, or should I define a macro 
something like the following seemingly broken code?

(defmacro ensure-ltk ((&rest options) &body body)
   (let ((fname (gensym)))
     `(labels ((,fname () , at body))
        (if (wish-stream *wish*)
            (,fname)
            (with-ltk ,options (,fname))))))

Thanks,
Daniel




More information about the ltk-user mailing list