Important: The information in this document is obsolete and should not be used for new development.
MyPanelInstall
A control panel extension must respond to thekPanelInstallSelectrequest code. A control panel sends this request code to an extension immediately after sending thekPanelGetDitlSelectrequest code (which initially adds your panels's items to the control panel) and just before displaying the panel to the user. A control panel extension typically responds to thekPanelInstallSelectrequest code by calling an extension-defined subroutine (for example,MyPanelInstall) to handle the request.
FUNCTION MyPanelInstall (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. The owning control panel displays your panel's items in the dialog box referenced through this parameter.
itemOffset- An offset to the panel's first item.
DESCRIPTION
YourMyPanelInstallfunction should perform any processing that must occur after the panel is created but before it is displayed to the user. For example, yourMyPanelInstallfunction can set or restore default values of various items in the panel. You can also use this opportunity to create user items (such as lists) in the panel.The
itemOffsetparameter specifies the offset from 1 to the first item in your panel. The items installed by your control panel extension are contained in a larger dialog box containing other items; as a result, if you call theGetDialogItemprocedure to obtain a handle to an item, you need to increment theitemNoparameter passed toGetDialogItemby the value ofitemOffset.In most cases, you'll need to save the value passed in the
itemOffsetparameter in your extension's global storage for later use. For example, you usually need this value to determine which panel item the user selected when your extension responds to thekPanelItemSelectrequest code.The value passed to your
MyPanelInstallfunction in theitemOffsetparameter may be different each timeMyPanelInstallis called. You should not assume it is always the same value.RESULT CODES
YourMyPanelInstallfunction should returnnoErrif successful, or an appropriate result code otherwise.SEE ALSO
For an example of theMyPanelInstallfunction, see Listing 5-4 on page 5-15.