Important: The information in this document is obsolete and should not be used for new development.
MyPanelRemove
A control panel extension must respond to thekPanelRemoveSelect
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 thekPanelRemoveSelect
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
YourMyPanelRemove
function should perform any processing that must occur before your panel is removed from the enclosing dialog box. For example, yourMyPanelRemove
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 timeMyPanelRemove
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 theGetDialogItem
procedure to obtain a handle to a dialog item, you need to increment theitemNo
parameter passed toGetDialogItem
by the value ofitemOffset
.The value passed to your
MyPanelRemove
function in theitemOffset
parameter may be different each timeMyPanelRemove
is called. You should not assume it is always the same value.RESULT CODES
YourMyPanelRemove
function should returnnoErr
if successful, or an appropriate result code otherwise.