Peter Herth <email@example.com> wrote:
| Rob Warnock wrote:
| > Uh... Is there a definition missing for CREATE-RECTANGLE somewhere?
| > I couldn't find it even in the latest snapshot of Ltk...
| Sorry, I was a little bit ahead of the time when I wrote that code :).
| The next release of Ltk (due in a few days) will contain it and other
| improvements. As a sneak preview here the missing function:
| (defun create-rectangle (canvas x0 y0 x1 y1)
| (send-w (format nil "puts [~a create rectangle ~a ~a ~a ~a]" (path canvas)
| x0 y0 x1 y1))
Thanks! A few more comments:
- In the previous article, there was a spurious letter "q" here:
(defparameter *tests* (test-+))q
- PATH and VALUE are still exported (and conflict with my ~/.cmucl-init).
- SEND-W and READ-W are not exported by Ltk, so CREATE-RECTANGLE
needs to be this:
(defun create-rectangle (canvas x0 y0 x1 y1)
(ltk::send-w (format nil "puts [~a create rectangle ~a ~a ~a ~a]"
(path canvas) x0 y0 x1 y1))
[Or maybe needs to be *in* the LTK package? ...and exported? Your pick.]
But given all that and the following, things now work fine:
> (load "ltk")
; Loading #p"/u/rpw3/ltk/ltk.x86f".
> (shadowing-import 'ltk:path)
> (shadowing-import 'ltk:value)
> (setf ltk::*wish-pathname* "wish8.3") ; local necessity
> (use-package :ltk)
> (load "foo.lisp") ; test framework code
; Loading #p"/u/rpw3/ltk/foo.lisp".
[...window pops up, tests run when button clicked...]
Rob Warnock <firstname.lastname@example.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607