gdk/gdk.go
func PixbufNewFromFile(filename string) (*Pixbuf, error) {
	cstr := C.CString(filename)
	defer C.free(unsafe.Pointer(cstr))

	var err *C.GError
	c := C.gdk_pixbuf_new_from_file((*C.char)(cstr), &err)
	if c == nil {
		defer C.g_error_free(err)
		return nil, errors.New(C.GoString((*C.char)(err.message)))
	}

	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	p := &Pixbuf{obj}
	//obj.Ref()
	runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() })
	return p, nil
}
func PixbufNewFromFile(filename string) (*Pixbuf, error) {
	cstr := C.CString(filename)
	defer C.free(unsafe.Pointer(cstr))

	var err *C.GError
	c := C.gdk_pixbuf_new_from_file((*C.char)(cstr), &err)
	if c == nil {
		defer C.g_error_free(err)
		return nil, errors.New(C.GoString((*C.char)(err.message)))
	}

	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	p := &Pixbuf{obj}
	//obj.Ref()
	runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() })
	return p, nil
}
func PixbufNewFromFile ( filename string ) ( * Pixbuf , error ) { cstr := C . CString ( filename ) defer C . free ( unsafe . Pointer ( cstr ) ) var err * C . GError c := C . gdk_pixbuf_new_from_file ( ( * C . char ) ( cstr ) , & err ) if c == nil { defer C . g_error_free ( err ) return nil , errors . New ( C . GoString ( ( * C . char ) ( err . message ) ) ) } obj := & glib . Object { glib . ToGObject ( unsafe . Pointer ( c ) ) } p := & Pixbuf { obj } //obj.Ref() runtime . SetFinalizer ( p , func ( _ interface { } ) { obj . Unref ( ) } ) return p , nil }
// PixbufNewFromFile is a wrapper around gdk_pixbuf_new_from_file().
PixbufNewFromFile is a wrapper around gdk_pixbuf_new_from_file () .