Permalink
Browse files

add settings.GetValue to get a Variant for complexly typed results

  • Loading branch information...
jmoiron committed Jun 24, 2016
1 parent 76e6c78 commit 4bb8ce836584474bb073ee6b9dc89523c10c5c30
Showing with 7 additions and 0 deletions.
  1. +1 −0 glib/glib.go
  2. +6 −0 glib/settings.go
View
@@ -24,6 +24,7 @@ package glib
// #include <glib-object.h>
// #include "glib.go.h"
import "C"
import (
"errors"
"fmt"
View
@@ -256,6 +256,12 @@ func (v *Settings) SetFlags(name string, value uint) bool {
return gobool(C.g_settings_set_flags(v.native(), cstr1, C.guint(value)))
}
func (v *Settings) GetValue(name string) *Variant {
cstr := (*C.gchar)(C.CString(name))
defer C.free(unsafe.Pointer(cstr))
return newVariant(C.g_settings_get_value(v.native(), cstr))
}
// GVariant * g_settings_get_value ()
// gboolean g_settings_set_value ()
// GVariant * g_settings_get_user_value ()

0 comments on commit 4bb8ce8

Please sign in to comment.