Contents
TwDefineEnumFromString (function)
DescriptionThis function is an alternative to TwDefineEnum. It creates a new TwType corresponding to a C/C++ enum. Thus the type could be used with TwAddVar* functions to control variables of type enum. Here the enum values are defined by a string containing a comma-separated list of labels. The first label is associated to 0, the second to 1, etc. ParametersnameSpecify a name for the enum type (must be unique). enumStringComma-separated list of labels. Return values
Exampleint density; TwType densityType; // Defining new enum type densityType = TwDefineEnumFromString("DensityType", "Low,Medium,High"); // Adding density to bar TwAddVarRW(bar, "Density", densityType, &density, NULL); See also |