示例#1
0
文件: glib.go 项目: leif/go-gtk
func TimeoutAdd(interval uint, f interface{}, datas ...interface{}) {
	var data interface{}
	if len(datas) > 0 {
		data = datas[0]
	}
	ctx := &SourcefuncContext{f, nil, reflect.ValueOf(data)}
	ctx.sfi = unsafe.Pointer(C._g_timeout_add(C.guint(interval), C.int(len(sourcefunc_contexts))))
	sourcefunc_contexts = append(sourcefunc_contexts, ctx)
}
示例#2
0
文件: glib.go 项目: mattn/go-gtk
func TimeoutAdd(interval uint, f interface{}, datas ...interface{}) {
	var data interface{}
	if len(datas) > 0 {
		data = datas[0]
	}
	ctx := &SourcefuncContext{reflect.ValueOf(f), reflect.ValueOf(data)}
	id := sourcefunc_contexts.Add(ctx)
	C._g_timeout_add(C.guint(interval), C.int(id))
}