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


MyPanelValidateInput

A control panel extension must respond to the kPanelValidateInputSelect request code. A control panel sends this request code to your extension whenever the user clicks a control panel's close box. A control panel extension typically responds to the kPanelValidateInputSelect request code by calling an extension-defined subroutine (for example, MyPanelValidateInput) to handle the request.

FUNCTION MyPanelValidateInput (globals: Handle; VAR ok: Boolean) 
                              : ComponentResult;
globals
A handle to the control panel extension's global data.
ok
On return, a Boolean value that indicates whether the panel's current values are valid (TRUE) or invalid (FALSE).
DESCRIPTION
Your MyPanelValidateInput function should perform any processing necessary to validate the current settings in the panel. For example, if your panel contains any editable text items, you might need to ensure that the text they contain makes sense. The control panel calls this function when the user clicks the control panel's close box.

If the current settings of the panel items are acceptable, set the ok parameter to TRUE before returning from MyPanelValidateInput. If the current settings are not valid, set ok to FALSE. When you set ok to FALSE, the control panel ignores any of the user's subsequent clicks in the panel's OK button.

RESULT CODES
Your MyPanelValidateInput 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