This is Calling-a-Service-from-the-App-which-supplies-it in view mode; [Up]
Date: Sun 11-Nov-1991 15:44:33 From: howie@ivory.cc.columbia.edu (Howie Kaye) Subject: Calling a Service from the App which supplies it Why can't an App which supplies a Service call that service from within itself? I have a small App which supplies a couple of services. I'd like to be able to call the App again on its own output, but the services it supplies do not appear in its "Services" menu. Other Apps seem to have the same problem (eg: try to select a word from within a definition in Webster, and then do a "Command-=" {define in Webster under Services} to define that word). The documentation on the Application class says that the menu is built up based on the PasteBoard types being passed. It doesn't say anything about excluding Services supplied by the App itself. So, how do i get the service to appear? registerServicesMenuSendTypes:andReturnTypes: - registerServicesMenuSendTypes:(const char *const *)sendTypes andReturnTypes:(const char *const *)returnTypes Registers pasteboard types that the application can send and receive in response to service requests. If the Application has a Services menu, a menu item is added for every service provider that can accept one of the specified send types or return one of the specified return types. This method should typically be invoked at application startup time or when an object that can use services is created. It can be invoked more than once; its purpose is to insure that there is a menu item for every service that may be used by the application. The individual items will be dynamically enabled and disabled by the event handling mechanism to indicate which services are currently appropriate. An application (or object instance that can cut or paste) should register every possible type that it can send and receive. Returns self. ------------------------------------------------------------ Howie Kaye howie@columbia.edu Columbia University hlkcu@cuvma.bitnet UNIX Systems Group ...!rutgers!columbia!howie
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.