Ejemplo n.º 1
0
func (bar *Bar) AddVarCB(name string, type_ Type, setCallback SetVarCallback, getCallback GetVarCallback, clientData unsafe.Pointer, def string) bool {
	currentSetVar := C.int(len(setVarCallbacks))
	currentGetVar := C.int(len(getVarCallbacks))

	setVarCallbacks = append(setVarCallbacks, setCallback)
	getVarCallbacks = append(getVarCallbacks, getCallback)

	return toBool(C.myAddVarCB((*C.TwBar)(bar), C.CString(name), C.TwType(type_), currentSetVar, currentGetVar, C.CString(def)))
}
Ejemplo n.º 2
0
func (bar *Bar) AddVarRO(name string, type_ Type, var_ unsafe.Pointer, def string) bool {
	return toBool(C.TwAddVarRO((*C.TwBar)(bar), C.CString(name), C.TwType(type_), var_, C.CString(def)))
}
Ejemplo n.º 3
0
func CreateStructMember(name string, type_ Type, offset uint, defString string) StructMember {
	return StructMember(C.myCreateStructMember(C.CString(name), C.TwType(type_), C.size_t(offset), C.CString(defString)))
}