You have taken the wrong road, traveller
Don't use a label to display slider values, use the SLIDER_LevelFormat tag instead. But because sliders only produce numeric values, you will need to setup a slider level hook and provide a hook function to convert the numbers.
First create the hook function that does the conversion:
char *slider_hook_function(struct Hook *hook, Object *gadget, struct TagItem *tags)
{
static char string[8];
int32 level = IUtility->GetTagData(SLIDER_Level, 0, tags);
if ( level == 11 ) sprintf(string, "AUTO");
else sprintf(string, "%d", (int) level);
return string;
}
Then setup the hook:
sliderHook = (struct Hook *)IExec->AllocSysObjectTags(ASOT_HOOK,
ASOHOOK_Entry, slider_hook_function,
ASOHOOK_Subentry, NULL,
ASOHOOK_Data, NULL, TAG_END);
In your GUI creation code, the slider gadget definition must include the following tags:
GA_RelVerify, TRUE,
SLIDER_Min, 0,
SLIDER_Max, 11,
SLIDER_LevelFormat, "%s",
SLIDER_LevelHook, sliderHook,
SLIDER_LevelMaxLen, 6,
The slider will display the labels automatically, the value conversion (11 = AUTO) is done by your hook function.
Of course, when you're done with your program you must free the hook because hooks are system resources:
if (sliderHook) IExec->FreeSysObject(ASOT_HOOK, sliderHook);