Contents
TwAddButton (function)
DescriptionThis function adds a button entry to a tweak bar. When the button is clicked by a user, the callback function provided to TwAddButton is called. ParametersbarThe tweak bar to which adding a new variable. name
The name of the button. It will be displayed in the tweak bar if no callbackThe callback function that will be called by AntTweakBar when the button is clicked. You should define this callback function like this: void TW_CALL Callback(void *clientData) { // do something } clientDataFor your convenience, this is a supplementary pointer that will be passed to the callback function when it is called. For instance, if you set it to an object pointer, you can use it to access to the object’s members inside the callback function. def
An optional definition string used to modify the behavior of this new entry. This string must follow the variable parameters syntax, or set to Return value
Examplevoid TW_CALL RunCB(void * /*clientData*/) { Gump.State = RUNNING; } // ... TwAddButton(bar, "Run", RunCB, NULL, " label='Run Forest' "); Remark
If you add a button without specifying Example: TwAddButton(bar, "comment1", NULL, NULL, " label='Life is like a box a chocolates' "); See also |