Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Cyberdog Programmer's Kit / Part 3 - Cyberdog Reference
Chapter 7 - Classes and Methods / CyberService


AppendCyberMenuCommands

Appends the menu items of this Cyberdog service to a Cyberdog service menu object.

void AppendCyberMenuCommands (in ODMenuBar menuBar, 
in ODPart part, 
in MenuHandle menuHnd, 
in long baseCommandID, 
out CyberMenuData menuData, 
out CyberMenuDataDestructorUPP menuDataDestructor);
menuBar
The ODMenuBar object to which the service should add its menus.
part
The part associated with the Cyberdog service menu object.
menuHnd
A handle to the menu to which the menu items should be added.
baseCommandID
The Cyberdog service menu object's base command ID for service-related commands.
menuData
A pointer to menu data that is passed to the function specified by menuDataDestructor.
menuDataDestructor
A pointer to a programmer-defined function that destroys the service's menu data when the CyberServiceMenu object is deleted.
DISCUSSION
This method should add this service's menu items to a Cyberdog service menu object. This method should append the service's menu items to the menu handle and registers the service's commands with the menu bar.

The output parameters menuData and menuDataDestructor provide a means for the service to associate some data with a service menu object. The service menu object stores the service's menu data and destructor. The service menu object passes the menu data to the service when it calls any of the service's menu-related methods. The menu data destructor is called when the service menu object is deleted. The destructor should deallocate the data pointed to by menuData. The superclass implementation of this method sets menuData and menuDataDestructor to nil.

The following type is used to define a menu data destructor. The function takes one parameter: a pointer of type void*; the function returns no value.

typedef void (* CyberMenuDataDestructorProcPtr) (
void* menuData);
The MyMenuDataDestructor programmer-defined function (page 192) illustrates the form of a menu data destructor function.

If you subclass CyberService and override this method, your override must not call its inherited method; that is, your override method must implement this method's functionality completely.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996