Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

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 Settings


MyPanelSetSettings

A control panel extension must respond to the kPanelSetSettingsSelect 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 the kPanelSetSettingsSelect 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
Your MyPanelSetSettings function should parse the block of configuration data passed in the ud 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 the ud parameter was created by a previous call to your extension's MyPanelGetSetting 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
Your MyPanelSetSettings function should return noErr if successful, or an appropriate result code otherwise.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice