Peter, again thanks for the information and advice, and belated thanks for creating ltk. I find the idea of using a textfield inside ltk for interactions with the repl appealing; now I just have to read some more to figure out what that means in practice :-) !
*** Without wishing to start/continue/renew any "my lisp/OS is better than yours" threads, and without cluttering up the list with code from my attempts, I remain puzzled that my experience with Allegro under Windows is so different.
I did succeed in using (start-wish) followed by some of your examples, which left me with a live repl .. until I wanted to get a response from eg. clicking on a button. Activating (mainloop) got the response, but the repl froze. C-c C-c in slime, plus choosing option 1 did get me an repl back. Short of killing my example window, this was the only way I could interrupt that mainloop.
What I still missed was the possibility, for example, of testing things by (a) using your "More complex example" with a live repl as above, and (b) from that repl writing something like (erase-line canvas-of-example (list ..)) to see it disappear.
*nix graphics seem to grab control of my lisp repl in a way I am not accustomed to, and for which I do not have a mental model (yet).
But, after dealing with some undergraduate examinations, it's on to trying to obtain repl interactions via textfields and Tk events!
Cheers /Greg
Peter Herth wrote:
Hi Greg,
On Sun, Dec 6, 2009 at 2:03 AM, Greg Bennett gwbennett@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.
Peter
ltk-user site list ltk-user@common-lisp.net http://common-lisp.net/mailman/listinfo/ltk-user