question/suggestion re: #'initialize for <Tk-composite-widget>

From: Moises Lejter <mlm_at_cs.brown.edu>
Date: Wed, 1 Mar 1995 15:30:25 -0500

[It seems this did not make it before, My apologies if you see it
twice -Moises]


As defined, #'initialize for <Tk-composite-widget> sets the Eid of the
widget to the Eid of the frame it creates. I guess this will work
most of the time. But, I found myself writing a child of
<Tk-composite-widget> called <TopLevel-composite> which is just a
composite widget as an independent top-level window. The code for
<Tk-composite-widget> now breaks, since the Eid for my
TopLevel-composite is not the Eid of the frame, but rather that of the
TopLevel around it.

I rewrote my #'initialize for <Tk-composite-widget> to read, in part:


(define-method initialize ((self <Tk-composite-widget>) initargs)
  ;; To work properly, the parent slot must be set before anything
  (let* ((parent (get-keyword :parent initargs *root*))
         (frame (make <Frame> :parent parent))
         ;; Eid should only be set if not already set by a subtype...
         ;; mlm_at_cs.brown.edu, 2/27/95
         (Eid (get-keyword :Eid initargs (slot-ref frame 'Id))))


Would this be a reasinable thing to make the default behavior for the
STk class library distributed with STk? (I would rather write my
classes to be usable in any other STk environment around, not just on
my own... :-) )

Thanks!

Moises

-----------------------------------------------------------------------------
Internet/CSnet: Moises_Lejter_at_brown.edu BITNET: mlm_at_browncs.BITNET
UUCP: ...!uunet!cs.brown.edu!mlm Phone: (401)863-7671
USmail: Moises Lejter, Box 1910 Brown University, Providence RI 02912
Received on Wed Mar 01 1995 - 21:31:54 CET

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