Patch for Canvitem.stk in STk-3.0b1...

From: Moises Lejter <mlm_at_cs.brown.edu>
Date: Wed, 6 Dec 1995 03:25:11 -0500 (EST)

I think the following patch is necessary, in order to use the STklos
Canvas classes.... (At least, I needed it, to run
"Examples/E1.stklos"...) It looked to me like someone started to
change Canvitem.stk, and never finished...

Moises

-----cut here-----

*** /tmp/T0a001O6 Wed Dec 6 03:20:41 1995
--- Canvitem.stk Wed Dec 6 03:16:41 1995
***************
*** 26,31 ****
--- 26,37 ----
    ((Cid :getter Cid))
    :metaclass <Tk-item-metaclass>)
  
+ (define-generic initialize-item)
+ (define-method initialize-item ((self <Tk-canvas-item>)
+ canvas coords initargs)
+ (apply canvas 'create (canvas-item-initializer self)
+ (append coords (get-keyword :tk-options initargs '()))))
+
  (define-method initialize ((self <Tk-canvas-item>) initargs)
    (let* ((parent (get-keyword :parent initargs #f))
           (coords (get-keyword :coords initargs '())))
***************
*** 36,49 ****
      (unless (is-a? parent <Canvas>)
         (error "**** Specified canvas ~A is not valid" parent))
  
- (let* ((parent-Id (slot-ref parent 'Id))
- (type (canvas-item-initializer self))
- (Cid (apply parent-Id
- 'create
- type
- (append coords
- (get-keyword :tk-options initargs '())))))
        (slot-set! self 'parent parent)
        (slot-set! self 'Id parent-Id)
        (slot-set! self 'Eid parent-Id)
        (slot-set! self 'Cid Cid)
--- 42,50 ----
      (unless (is-a? parent <Canvas>)
         (error "**** Specified canvas ~A is not valid" parent))
  
      (slot-set! self 'parent parent)
+ (let* ((parent-Id (slot-ref parent 'Id))
+ (Cid (initialize-item self parent-Id coords initargs)))
        (slot-set! self 'Id parent-Id)
        (slot-set! self 'Eid parent-Id)
        (slot-set! self 'Cid Cid)

-----cut here-----
Received on Wed Dec 06 1995 - 09:27:55 CET

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