func SetProperty(obj ObjectLike, propName string, value interface{}) { cpn := GString(propName) defer cpn.Free() v := ConvertToC(value) defer v.Free() C.g_object_set_property(C.to_GObject(obj.ToNative()), (*C.gchar)(cpn.GetPtr()), (*C.GValue)(v.ToCGValue())) }
func GetProperty(obj ObjectLike, propName string) *GValue { pspec := FindProperty(obj, propName) if pspec == nil { return nil } gv := CreateCGValue(pspec.GetType()) pn := GString(propName) defer pn.Free() C.g_object_get_property(C.to_GObject(obj.ToNative()), (*C.gchar)(pn.GetPtr()), (*C.GValue)(gv.ToCGValue())) return gv }
func (v *GObject) SetProperty(name string, val *GValue) { str := C.CString(name) defer C.free_string(str) C.g_object_set_property(C.to_GObject(v.Object), C.to_gcharptr(str), &val.Value) }