LWM - no services menu
I'm cc'ing support here as well, but have any other LWM users noticed
that the Services menu is empty on both the IDE and any applications
created with CAPI? The docs say (well, actually the sample code says,
since the docs refer the reader to /Applications/LispWorks 5.0/
Library/lib/5-0-0-0/examples/capi/applications/cocoa-
application.lisp) that:
;; This is a special named component where the CAPI will
;; attach the standard Services menu.
:name :application-services
However, at least on 5.0.1 (Intel), the services menu is empty, both
in the IDE, and the examples provided. Possibly this has something to
do with the fact that LispWorks' main menu is not merely a plain
vanilla NSMenu as in your typical cocoa app, but rather an instance
of LWCAPIMenuRepresentation, a custom subclass of NSMenu[1]. In
addition calling the equivalent of [[NSApplication sharedApplication]
servicesMenu] returns nil, so there is nothing provided by LispWorks
for a services menu.
So, first, do others see this?
Second, is there any fix availably or likely? I can't help thinking
that this is related to Bill Atkins' problem with drag and drop. The
services menu is populated when the user clicks on it by determining
if there are any objects in the responder chain within the
application that could utilize any of the available services.
Similarly, drags are supposed to be forwarded up the responder chain,
but as Bill Atkins' problem showed, drags are not forwarded if they
are to CAPI panes, even capi:cocoa-view-panes. It would seem that
CAPI may not be forwarding events up the responder chain in the way
that the AppKit expects.
regards,
Ralph
[1]
(defmacro @ (&body body) `(objc:invoke ,@body))
(defmacro @into (&body body) `(objc:invoke-into ,@body))
(defmacro @pool (&body body) `(objc:with-autorelease-pool () ,@body))
(defmacro @bool (&body body) `(objc:invoke-bool ,@body)) ;; not used
here but useful
(defvar *nsapp* (@ "NSApplication" "sharedApplication"))
(defvar *main-menu* (@ *nsapp* "mainMenu"))
(defvar *services-menu* (@pool (@ *nsapp* "servicesMenu")))
(defun objc-class-name (an-object) (@pool (@into 'string an-object
"className")))
(defun ns-menu-p (an-object) (@bool an-object "isKindOfClass:" (@
"NSMenu" "class")))
CL-USER 2 > (objc-class-name *main-menu*)
"LWCAPIMenuRepresentation"
CL-USER 3 > (ns-menu-p *main-menu*)
T
CL-USER 4 > *services-menu*
#<Pointer: OBJC:OBJC-OBJECT-POINTER = #x00000000>
Raffael Cavallaro, Ph.D.
raffaelcavallaro@mac.com