Allows an arbitrary Cocoa view class to be used on the Macintosh.
A string naming the view class to use.
A function that initializes the view class.
cocoa-view-pane allows an instance of an arbitrary Cocoa view class to be displayed within a CAPI interface.
When the pane becomes visible, the CAPI allocates and initialize a Cocoa view object using the initargs as follows:
is specified, then it should be a string naming the Cocoa view class to allocate. Otherwise the class
NSView is allocated.
nil, then it should be a function which is called with of two arguments, the pane and a foreign pointer to the newly allocated Cocoa view object. The function should initialize the Cocoa view object in whatever way is required, including invoking the appropriate Objective-C initialization method, and return the initialized view. If
nil then the Objective-C method
init is called and the result is returned.
After the Cocoa view has been initialized, the function cocoa-view-pane-view can be used the retrieve it.
You can use the functions
(setf cocoa-view-pane-view-class) and
(setf cocoa-view-pane-init-function) to modify the
, but the values will be ignored if this is done after the pane becomes visible.
LispWorks Objective-C and Cocoa Interface User Guide and Reference Manual
for details on using Cocoa.
cocoa-view-pane is implemented only in LispWorks for Macintosh with the Cocoa IDE.
The following code uses
cocoa-view-pane to display an
NSMovieView displaying an existing movie.
(defun show-movie (movie)
#'(lambda (pane view)
(objc:invoke view "init"))
(objc:invoke view "setMovie:" movie)
CAPI User Guide and Reference Manual (Unix version) - 25 Feb 2015