Ejemplo n.º 1
0
/*
Finds or creates an atom corresponding to a given string.
*/
func AtomIntern(atom_name string, only_if_exists bool) (return__ C.GdkAtom) {
	__cgo__atom_name := (*C.gchar)(unsafe.Pointer(C.CString(atom_name)))
	__cgo__only_if_exists := C.gboolean(0)
	if only_if_exists {
		__cgo__only_if_exists = C.gboolean(1)
	}
	return__ = C.gdk_atom_intern(__cgo__atom_name, __cgo__only_if_exists)
	C.free(unsafe.Pointer(__cgo__atom_name))
	return
}
Ejemplo n.º 2
0
func AtomIntern(atomName string, onlyIfExists bool) Atom {
	s := gobject.GString(atomName)
	defer s.Free()
	b := gobject.GBool(onlyIfExists)
	defer b.Free()

	o := C.gdk_atom_intern((*C.gchar)(s.GetPtr()), *((*C.gboolean)(b.GetPtr())))

	a := Atom{}
	a.object = new(C.GdkAtom)
	*a.object = o

	return a
}
Ejemplo n.º 3
0
Archivo: gdk.go Proyecto: raichu/gotk3
// GdkAtomIntern is a wrapper around gdk_atom_intern
func GdkAtomIntern(atomName string, onlyIfExists bool) Atom {
	cstr := C.CString(atomName)
	defer C.free(unsafe.Pointer(cstr))
	c := C.gdk_atom_intern((*C.gchar)(cstr), gbool(onlyIfExists))
	return Atom(uintptr(unsafe.Pointer(c)))
}