inheritance problems ?

From: Brian Denheyer <briand_at_northwest.com>
Date: Sat, 23 May 1998 11:49:30 -0700 (PDT)

I am trying to get xxl to work with stk 3.99.1 and I am getting an
error message which I just can't figure out :

*** Error at line 182 of file ./test.stk:
No applicable method for #[<generic> compute-tk-virtual-get-n-set (4)]
in call (compute-tk-virtual-get-n-set #[<tk-table-metaclass> <table> 401d63a0] :width)


Here is the code :

(require "Basics")
(require "utils")

;;
;; Tk-table-metaclass specifes access functions to slots of table class
;; read access by cget (ie (slot-ref (current-table) 'background))
;; write acces by configure (ie (slot-ref (current-table) 'background "red"))
(define-class <Tk-table-metaclass> (<With-Tk-virtual-slots-metaclass>)
  ())

(define-method compute-tk-virtual-get-n-set ((class <Tk-table-metaclass>)
                                             tk-name)
  (list
   (lambda (o) ((slot-ref o 'Id) 'cget tk-name))
   (lambda (o v) ([slot-ref o 'Id] 'configure tk-name v))))

(define-class <Table> (<Tk-simple-widget> <Tk-sizeable>)
  (
   ;; table-name to access the variable link to
   ;; the table data structure (an hash-table)
   table-name
   data-table ;; the table data structure itself
   
   ;; tags list associated to Table
   (tags :initform (make-hash-table))

   ;; hidden cols and rows, keep orignal width and height
   ;; Alist: (col width) (row height)

   (hidden-cols :initform ()
                :getter get-hidden-cols
                :setter set-hidden-cols!)

<big-snip>)

  :metaclass <Tk-Table-metaclass>)

Looks like stk now checks for duplicate slot entries in a class
definition e.g. :

  define-class: bad list of slots (table-name data-table (tags :initform (make-ha

Any chance the error message could include something like :

  duplicate slot xxx

That would be helpful for classes with long lists of slots.


Brian

-- 
Brian Denheyer
briand_at_northwest.com
Received on Sat May 23 1998 - 19:43:57 CEST

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