public static void AddVarCB(IntPtr bar, String name, VariableType type, SetVarCallback setCallback, GetVarCallback getCallback, IntPtr clientData, String def)
{
if (bar == IntPtr.Zero) {
throw new ArgumentOutOfRangeException("bar");
} else if (type == VariableType.Undefined) {
throw new ArgumentOutOfRangeException("type");
} else if (name == null) {
throw new ArgumentNullException("name");
} else if (getCallback == null) {
throw new ArgumentNullException("getCallback");
}
if (!NativeMethods.TwAddVarCB(bar, name, type, setCallback, getCallback, clientData, def)) {
throw new AntTweakBarException("TwAddVarCB failed.");
}
}