Esempio n. 1
0
File: glib.go Progetto: 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)
}
Esempio n. 2
0
File: glib.go Progetto: 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))
}