1 Star 0 Fork 0

李超/gotk3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gfile.go 700 Bytes
一键复制 编辑 原始数据 按行查看 历史
package glib
// #include <gio/gio.h>
// #include <glib.h>
// #include <glib-object.h>
// #include "glib.go.h"
import "C"
import "unsafe"
type File struct {
*Object
}
// Native() returns a pointer to the underlying GFile.
func (v *File ) Native() *C.GFile {
if v == nil || v.GObject == nil {
return nil
}
return C.toGFile(unsafe.Pointer(v.GObject))
}
// FileNew is a wrapper around g_file_new_for_path().
func FileNew(title string) *File {
cstr1 := (*C.char)(C.CString(title))
defer C.free(unsafe.Pointer(cstr1))
c := C.g_file_new_for_path(cstr1)
if c == nil {
return nil
}
return wrapFile(wrapObject(unsafe.Pointer(c)))
}
func wrapFile(obj *Object) *File {
return &File{obj}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/telhello1/gotk3.git
git@gitee.com:telhello1/gotk3.git
telhello1
gotk3
gotk3
v0.4.0

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385