[ltk-user] First use of ltk

Peter Herth herth at peter-herth.de
Sun Dec 6 09:35:42 UTC 2009

Hi Greg,

On Sun, Dec 6, 2009 at 2:03 AM, Greg Bennett <gwbennett at sentex.ca> wrote:
> Peter, thanks for the message; thanks also to Daniel Herring and Victor.
> It turns out that I did not have tcl and tk installed. I now have them
> and all is well in that at the shell (bash)
> wish -> a blank window and a % prompt
> while inside SBCL
> (ltktest) and (ltk::ltk-eyes) do their thing.
> As does the first example from the documentation.
> So thanks all, once more.

Good that this was resolved so easily :)

> ;;;;
> My lisp experience is with Franz's Allegro and their common graphics.
> There I can open a window and keep the listener/repl alive.
>  From the repl
> (setf w make-a-window-syntax)
> then allows me to do things like
> (draw-to w some-graphic)
> from that REPL.
> This facility is important to the application I'm interested in porting;
> I guess it
> means that I must learn how to program with threads/processes to obtain
> this behaviour.

First of all - you can interactively call start-wish to start a wish session and
then use all LTk-functions from the repl (you will get events handles only
if you call process-events or mainloop). However this is only for testing and
interactive development.

If you want to have a lisp repl within a LTk program, I would not recommend
threads. Amongst all other possible problems, the LTk functionality should be
used only from one thread. But fortunately, this is not necessary if you want
for example just integrate a lisp listener into a LTk program. The
easiest solution
would be, to use a textfield for the repl interaction and trigger the
Lisp evaluation
from the corresponding Tk events - no threads needed. ABLE implements a
small Lisp IDE completely in LTk.


More information about the ltk-user mailing list