callbacks with <Button>s

From: <deline_at_src.dec.com>
Date: Fri, 15 Jul 94 12:10:09 -0700

Hello all. I'm trying to use the various Tk-classes that come with
STk and am running into some trouble. Take the following as an example.

When I try this expression:

    (let ((b (make <Button>)))
        (set! (command b) `(describe ,b))
        (pack b))

I get the following message when I click on the newly created button:

    *** Read from string error:
    bad # syntax: "#"

However, a slight modification corrects the problem:

    (let ((b (make <Button>)))
        (set! (command b) `(describe (Id->instance ,(Id b))))
        (pack b))

What strikes me as odd is that the result of Id has roughly the same
syntax as the object itself (#[<button> 1016f110] versus #[Tk-command
.v1]), yet one has "bad # syntax" and the other doesn't.

I was expecting the first expression to work (should I have?), so
is this a bug?

Thanks,
Rob DeLine
Received on Fri Jul 15 1994 - 21:18:55 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST