MyPanelGetSettingsA control panel extension must respond to the
kPanelGetSettingsSelectrequest code. A control panel sends this request code to your extension to get the panel's current settings. A control panel extension typically responds to the
kPanelGetSettingsSelectrequest code by calling an extension-defined subroutine (for example,
MyPanelGetSettings) to handle the request.
FUNCTION MyPanelGetSettings (globals: Handle; VAR ud: UserData; flags: LongInt): ComponentResult;
- A handle to the control panel extension's global data.
- A handle to the control panel's configuration data.
- Reserved. This parameter is always 0.
MyPanelGetSettingsfunction should return, through the
udparameter, a copy of the panel's current settings. This copy is maintained privately by the control panel. The control panel may subsequently restore your panel's settings by passing those settings to your
Your control panel extension is responsible for allocating storage for the configuration data to which
udis a handle. You might do that when the Component Manager passes your extension the
kComponentOpenSelectparameter. Your extension should not dispose of that storage until it closes (that is, when the Component Manager passes it the
You can arrange the panel configuration data in any way you like. The data needs to contain whatever information is necessary for your
MyPanelSetSettingfunction to set all relevant panel items to specified values. For example, the standard Apple sound panels save information such as the component type of the default sound output device, the current volumes levels, the current alert beep, and so forth. You might want to begin the configuration data with a version number so that you can easily change the format of the rest of the data, if necessary.
The information you return to the control panel may get stored as part of the owner's configuration information and might therefore persist across system restarts. As a result, you should not store values that might change without the control panel's knowledge (such as component ID numbers, file reference numbers, and similar volatile information).
MyPanelGetSettingsfunction should return
noErrif successful, or an appropriate result code otherwise.