Important: The information in this document is obsolete and should not be used for new development.
MyPanelSetSettings
A control panel extension must respond to thekPanelSetSettingsSelect
request code. A control panel sends this request code to your extension to request that your extension set the panel's current settings to the specified values. A control panel extension typically responds to thekPanelSetSettingsSelect
request code by calling an extension-defined subroutine (for example,MyPanelSetSettings
) to handle the request.
FUNCTION MyPanelSetSettings (globals: Handle; ud: UserData; flags: LongInt): ComponentResult;
globals
- A handle to the control panel extension's global data.
ud
- A handle to the control panel's configuration data.
flags
- Reserved. This parameter is always 0.
DESCRIPTION
YourMyPanelSetSettings
function should parse the block of configuration data passed in theud
parameter and set the values of the items in the panel based on that data. The control panel calls this function just before your panel is displayed to the user and whenever a user cancels changes to your panel. You can assume that the data passed in theud
parameter was created by a previous call to your extension'sMyPanelGetSetting
function.It's possible that your extension might not able to set the value of one or more panel items to the values specified in the configuration data. (For example, the hardware environment might have changed since the configuration data was last stored by the control panel.) When this happens, you should try to match the specified panel settings as closely as possible. If you cannot match perfectly, you should return some nonzero result code.
RESULT CODES
YourMyPanelSetSettings
function should returnnoErr
if successful, or an appropriate result code otherwise.