Re: setting widget names in STklos

From: Erick Gallesio <>
Date: Tue, 10 Sep 1996 23:10:55 +0200

> I'd like to propose a small addition. Allow the programmer to pass in
> an initializer, say `:name', when creating any widget with `make'. If
> present, this is appended to the parent's ID to create the new
> widget's ID (e.g., ".v1.v3.v6.input"). If not, it's generated
> automatically in the old way.
> This requires a change to Tk::make-tk-name (changing the meaning of
> the second argument, which seems to be unused in the library)

The second argument was for this purpose in fact. I first thougth to
use Id as the slot to do that job (since Id contains name of the Tk widget associated to the STklos object). The problem with this approach is
that you specify a value for Id but this is only reflected in the suffix
of the Id:
        STk> (define f (make <Frame>))
        STk> (Id f)
        #[Tk-command .v232]
        STk> (define g (make <Button> :parent f :Id "foo"))
        STk> (Id g)

On the other side, your solution use a new init keyword which is not
associated to a slot (but we can imagine to define it as a real slot, even if its value will not be used by the MOP, to be orthogonal).

What is the opinion of the mailing list about this?

                -- Erick
Received on Tue Sep 10 1996 - 23:41:08 CEST

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