Chapter 2. DCODs
msgData
parameter for all DCOD messages (including pDialogCall
) is a pointer to a record having this structure:
typedef struct { char *title; EntryRef *entry; int returnValue; } DCODParams;If the DCOD uses a dialog, the dialog's title should be set using the
title
field. Usually, this string comes from the "Title" attribute of a dialog entry in the script.
The entry
field is a reference to the entry to be used by the DCOD. To read and modify the script, the DCOD will pass entry
to various script interpreter utilities.
The value of returnValue
should be set to TRUE
or FALSE
by the DCOD after handling the message. This return value is different from the return value of main()
(which should be TRUE
, because the message was handled).
If the DCOD has a modal dialog, returnValue
should be set to 1
if the user hits OK and 0
if the user hits Cancel. If the DCOD opens a non-modal dialog, returnValue
should be -1
(see "2.2 Asynchronous DCODs"). Otherwise, returnValue
should be set to 1
if changes made to the script by the DCOD should be kept, or 0
if they should be undone.
DCOD messages can always be accepted though the main()
function; no message table is required. (See "1.3 PSYX Calling Conventions".)
Generated with CERN WebMaker