From: ·······@kneuro.net
Subject: LTK -- configure doesn't seem to work
Date: 
Message-ID: <1160088795.284447.126070@c28g2000cwb.googlegroups.com>
Hi,

When running the following LTK code, I'd expect the text of the label
to
change when I press the "Change" button, but that does not happen,
althouth the "Reconfigured label" message does get printed. Also,
with *debug-tk* set, I do see a "configure" command for the label
being sent to wish, but with no apparent effect.

Analogous Tcl code run under wish works as expected. I am running
this code in CLISP under Cygwin.

(defun test-configure ()
       (with-ltk ()
         (let* ((lbl (make-instance 'label :master nil :text "Hello"))
                (btn (make-instance 'button :text "Change" :master nil
:command

(lambda ()

    (configure lbl :text "Goodbye")

    (format t "Reconfigured label.~&")))))
           (grid btn 0 0)
           (grid lbl 0 1))))
(test-configure)

Is there anything wrong with this code? Or do I misunderstand
how LTK works?

Thanks,

-- JK

From: Ken Tilton
Subject: Re: LTK -- configure doesn't seem to work
Date: 
Message-ID: <ahkVg.153$ds1.17@newsfe11.lga>
·······@kneuro.net wrote:
> Hi,
> 
> When running the following LTK code, I'd expect the text of the label
> to
> change when I press the "Change" button, but that does not happen,
> althouth the "Reconfigured label" message does get printed. Also,
> with *debug-tk* set, I do see a "configure" command for the label
> being sent to wish, but with no apparent effect.
> 
> Analogous Tcl code run under wish works as expected. I am running
> this code in CLISP under Cygwin.
> 
> (defun test-configure ()
>        (with-ltk ()
>          (let* ((lbl (make-instance 'label :master nil :text "Hello"))
>                 (btn (make-instance 'button :text "Change" :master nil
> :command
> 
> (lambda ()
> 
>     (configure lbl :text "Goodbye")
> 
>     (format t "Reconfigured label.~&")))))
>            (grid btn 0 0)
>            (grid lbl 0 1))))
> (test-configure)
> 
> Is there anything wrong with this code? Or do I misunderstand
> how LTK works?

Here is a wild guess: try (setf (text lbl) "Goodbye")

i think Ltk tries to hide TK configure behind slot accessors, and you 
may have left out some necessary internal wiring by going directly at it.

But I really am just guessing. Have you tried the LTk list itself?

kt
From: ·······@kneuro.net
Subject: Re: LTK -- configure doesn't seem to work
Date: 
Message-ID: <1160147129.277251.160520@h48g2000cwc.googlegroups.com>
Ken Tilton wrote:
> ·······@kneuro.net wrote:
> > Hi,
> >
> > When running the following LTK code, I'd expect the text of the label
> > to
> > change when I press the "Change" button, but that does not happen,

[snip]

> Here is a wild guess: try (setf (text lbl) "Goodbye")

That works.  I actually did try it earlier, but must have done
some basic thing wrong, since that time it gave me an error
indicating that setf was not applicable.  Probably I
said (setf (text lbl) :text "Goodbye"), bonehead that I
am sometimes...

> i think Ltk tries to hide TK configure behind slot accessors, and you
> may have left out some necessary internal wiring by going directly at it.
>
> But I really am just guessing. Have you tried the LTk list itself?

I trolled their archives, but didn't post a query.  Anyway, thanks
very much.

-- JK