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: Operating System Utilities /
Chapter 5 - Control Panel Extensions / Control Panel Extensions Reference
Control Panel Extension-Defined Routines / Managing Panel Components


MyPanelRemove

A control panel extension must respond to the kPanelRemoveSelect request code. A control panel sends this request code to an extension just before removing the panel from the enclosing dialog box. A control panel extension typically responds to the kPanelRemoveSelect request code by calling an extension-defined subroutine (for example, MyPanelRemove) to handle the request.

FUNCTION MyPanelRemove (globals: Handle; dialog: DialogPtr; 
                        itemOffset: Integer): ComponentResult;
globals
A handle to the control panel extension's global data.
dialog
A pointer to the dialog record of the owning control panel.
itemOffset
An offset to the panel's first item.
DESCRIPTION
Your MyPanelRemove function should perform any processing that must occur before your panel is removed from the enclosing dialog box. For example, your MyPanelRemove function can save the current values of any items in the dialog box. You can also use this opportunity to dispose of any user items (such as lists) in the dialog box. If the control panel opened your component's resource file, that file is still open at the time MyPanelRemove is called.

The itemOffset parameter specifies the offset from 1 to the first item in your control panel. The dialog items installed by your control panel extension are contained in a larger dialog box containing other items; as a result, if you call the GetDialogItem procedure to obtain a handle to a dialog item, you need to increment the itemNo parameter passed to GetDialogItem by the value of itemOffset.

The value passed to your MyPanelRemove function in the itemOffset parameter may be different each time MyPanelRemove is called. You should not assume it is always the same value.

RESULT CODES
Your MyPanelRemove function should return noErr if successful, or an appropriate result code otherwise.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996