Name
ColorRequest -- open a color requester (V6.0, optional)
Synopsis
int error = ColorRequest(APTR handle, STRPTR title, ULONG flags,
                int *result, struct hwTagList *tags);
Function
This function must open a color requester, i.e. a dialog box that prompts the user to select a color. The color must be returned to Hollywood by writing an RGB value to the int pointer that has been passed as parameter 4. If the user has cancelled the requester, ColorRequest() has to write -1 to the result pointer.

Hollywood also passes a taglist to this function. Your implementation has to handle the following tags:

HWCOLORREQTAG_FROMSCRIPT:
The iData member of this tag item is set to True if Hollywood has called you while the script is running. This might be important to know because requesters should not block window refresh so you might want to setup a temporary modal event loop if this tag has been set to True to enable your display to stay responsive.

HWCOLORREQTAG_DEFCOLOR:
If this tag is present, Hollywood wants you to preselect the color that has been passed in the iData member of this tag item in the color requester.

Note that Hollywood won't call FreeRequest() for this requester type because ColorRequest() shouldn't have to allocate any resources.

ColorRequest() is an optional API and must only be implemented if HWSRAFLAGS_COLORREQUEST has been passed to hw_SetRequesterAdapter(). See hw_SetRequesterAdapter for details.

Inputs
handle
display handle or NULL if no display is open
title
title string for the requester's window
flags
reserved for future use (currently 0)
result
int pointer for storing the user's selection
tags
taglist for additional options (see above)
Results
error
error code or 0 for success

Show TOC