ron at awun.net
Fri Nov 2 23:09:18 UTC 2007
Poking through the easygui code I encountered this intriguing tidbit:
(defclass cocoa-drawing-view (ns:ns-view)
Gotta love a language where you can define something called "define-
So I decided to see what a cocoa-drawing-view did. I tried this:
(add-subviews (make-instance 'window) (make-instance 'cocoa-drawing-
which doesn't work because cocoa-drawing-views are ns:ns-views, not
views. Ten minutes of head-scratching and reverse-engineering later I
came up with this:
(setf w (make-instance 'window))
(setf d (make-instance 'cocoa-drawing-view))
(dcc (#/addSubview: (cocoa-ref w) d))
Calling addSubview: on (#<NS-WINDOW <NSWindow: 0xc4cd8f0> (#xC4CD8F0)>
#<COCOA-DRAWING-VIEW <CocoaDrawingView: 0xc409d10> (#xC409D10)>)
> Error: Objective-C runtime exception:
> *** -[NSWindow addSubview:]: unrecognized selector sent to
> While executing: #<Anonymous Function #x3000411F1AAF>, in process
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
at which point I decided it was time to ask for help. Accordingly...
More information about the Openmcl-devel