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) }
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)) }