[Openmcl-devel] How to send a message to the objc super-class ?

Didier Verna didier at lrde.epita.fr
Sat Feb 9 18:30:27 UTC 2008

I wrote:

> mikel evins <mevins at mac.com> wrote:
>> We're working on it; in the meantime, can you use ccl::define-objc-
>> method instead of objc:defmethod?
>   Actually, I've now tried call-next-method, and ccl::define-objc-method
> as follows:
> (objc:defmethod (#/drawWithFrame:inView: :void)
>     ((self outline-cell) frame view)
>   (call-next-method frame view))
> (ccl::define-objc-method ((:void :draw-with-frame (:id frame)
>                            :in-view (:id view)) outline-cell)
>   (ccl::send-super :draw-with-frame frame :in-view view))
> Both compile and execute without any complaint, but nothing is drawn,
> which suggests to me that the actual super-method isn't executed... ?

I have made some progress on this. As I said, the following compiled but
didn't draw anything:

(objc:defmethod (#/drawWithFrame:inView: :void)
    ((self outline-cell) frame view)
  (call-next-method frame view))

I have discovered that I can further specify the type of the frame
argument like this:

(objc:defmethod (#/drawWithFrame:inView: :void)
    ((self outline-cell) (frame :<NSR>ect) view)
  (call-next-method frame view))

and then, it works like a charm. Not sure if it's a bug or what.

    But now, I'm hopelessly confused about some naming conventions. Here
are a couple of questions related to type specifications in

1/ should I use :bool or :<BOOL> ?
2/ should I use :void or :<VOID> ? (you get the idea)
3/ in the method above, I can specialize the frame argument to :<NSR>ect
   (I even *have* to). However, if I want to specialize the view
   argument to :<NSV>iew (or :<NSO>utline<V>iew in my case), I get this:

> Error: Unknown foreign type: :<NSV>IEW
> While executing: CCL::%PARSE-FOREIGN-TYPE, in process listener(1).

4/ In fact, it seems that I can't specialize the view argument to
   anything at all; not even ns:ns-view.

5/ On the other hand, I'm using ns:ns-outline-view as a type specializer
   in some other method somewhere (that's a different naming
   convention), and it works well. 

Please help me; I'm lost :-)

Resistance is futile. You will be jazzimilated.

Didier Verna, didier at lrde.epita.fr, http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire   Tel.+33 (0)1 44 08 01 85
94276 Le Kremlin-Bicêtre, France   Fax.+33 (0)1 53 14 59 22  didier at xemacs.org

More information about the Openmcl-devel mailing list