TwAddSeparator (function)

int TwAddSeparator(TwBar *bar, const char *name, const char *def)


This function adds a horizontal separator line to a tweak bar. It may be useful if one wants to separate several sets of variables inside a same group.

Note that you can also add a line of text in a tweak bar using a special button, see TwAddButton.



The tweak bar to which adding the separator.


The name of the separator. It is optional, this parameter can be set to NULL. But if you need to refer to this separator later in other commands, name it (like for other var names, choose a unique, simple and short name, and avoid special characters like spaces or punctuation marks).


An optional definition string used to modify the behavior of this new entry. This string must follow the variable parameters syntax, or set to NULL to get the default behavior. It could be set or modified later by calling the TwDefine or TwSetParam functions.

Return value

  • 1 if the separator was successfully added to the tweak bar.
  • 0 if an error occurred (call TwGetLastError to retrieve the error).


TwAddSeparator(bar, NULL, " group='Parameters' ");
TwAddSeparator(bar, "sep1", NULL);
TwDefine(" barName/sep1 group='Parameters' ");

See also