MyPanelGetDITLA control panel extension must respond to the
kPanelGetDitlSelectrequest code. A control panel sends this request code to an extension to obtain a list of the panel's items. A control panel extension typically responds to the
kPanelGetDitlSelectrequest code by calling an extension-defined subroutine (for example,
MyPanelGetDITL) to handle the request.
FUNCTION MyPanelGetDITL (globals: Handle; VAR ditl: Handle) : ComponentResult;
- A handle to the control panel extension's global data.
- On entry, a handle to a block of memory in your application heap. On exit, a handle to an item list.
MyPanelGetDITLfunction should return, through the
ditlparameter, an item list of the items supported by your extension. The control panel then places those items into the control panel and, after installing the panel, displays the panel to the user. When the control panel creates the panel, it places the items at the locations specified in the item list.
On entry to your
ditlparameter contains a handle to a block of memory in your application heap. You should resize the handle as necessary to hold the item list you return to the control panel. (If you use a Resource Manager routine such as
Get1Resource, the Resource Manager automatically resizes the handle for you.)
In general, the owning control panel disposes of the handle you pass it once it's finished constructing the panel. As a result, you must make sure that the handle you pass to the control panel is not a resource handle. If you obtain your item list by reading it into memory from a resource, you should call the Resource Manager's
DetachResourceprocedure to convert that resource handle into one that is suitable for use with the
componentFlagsfield of the component description record for a control panel extension contains a bit flag,
channelFlagDontOpenResFile, that indicates whether the control panel should open your extension's resource file before calling your extension.
channelFlagDontOpenResFilecomponent flag to 0 if you want the control panel to open your extension's resource file before calling your extension. Set the
channelFlagDontOpenResFilecomponent flag to 1 to specify that the control panel should not open your extension's resource file before calling your extension.
MyPanelGetDITLfunction should return
noErrif successful, or an appropriate result code otherwise.
SEE ALSOFor an example of the
MyPanelGetDITLfunction, see Listing 5-3 on page 5-14.