Contents
TwGetParam (function)
DescriptionThis function returns the current value of a bar or variable parameter. Parameters define the behavior of bars and vars and may have been set or modified by functions TwDefine, TwAddVar* or TwSetParam. Parametersbar
Bar identifier. If the requested parameter is global (not linked to a particular bar), varName
If the parameter is directly related to a bar (and not specific to a var), paramNameName of the parameter. This is one of the key words listed in the bar parameters page if the parameter is directly related to a bar, or listed in the var parameters page if the parameter is related to a variable. paramValueType
Type of the data to be stored in outValues. Should be one of the constants defined by TwParamValueType: outValueMaxCount
Each parameter may have one or more values (eg., a position parameter has two values x and y).
If the parameter value is of type string, outValuesPointer to the buffer that will be filled with the requested parameter values. The buffer must be large enough to contain at least outValueMaxCount values of type specified by paramValueType. Examples// get the current position of a bar int pos[2]; TwGetParam(bar, NULL, "position", TW_PARAM_INT32, 2, pos); // check if a group is opened or closed int opened; TwGetParam(bar, "groupname", "opened", TW_PARAM_INT32, 1, &opened); // get a variable min value double vmin; TwGetParam(bar, "varname", "min", TW_PARAM_DOUBLE, 1, &vmin); // get the name of the group including a variable char group[128]; // 128 chars max TwGetParam(bar, "varname", "group", TW_PARAM_CSTRING, 128, group); // get the global iconmargin int margin[2]; TwGetParam(NULL, NULL, "iconmargin", TW_PARAM_INT32, 2, margin); Return value
See also |