Пример #1
0
func (self *GList) Foreach(f interface{}, data ...interface{}) {
	// Create id and closure
	cl, _ := gobject.CreateCustomClosure(f, data...)
	listLength := int(self.Length())

	for i := 0; i < listLength; i++ {
		data := self.NthData(uint(i))
		if data != nil {
			cl([]interface{}{data})
		}
	}
}
Пример #2
0
func GIdleAddFull(priority int, callback interface{}, data ...interface{}) uint {
	cl, id := gobject.CreateCustomClosure(callback, data...)
	_closures[id] = cl
	return uint(C._g_idle_add_full(C.gint(priority), C.gint64(id)))
}
Пример #3
0
func GTimeoutAddSecondsFull(priority int, interval uint, callback interface{}, data ...interface{}) uint {
	cl, id := gobject.CreateCustomClosure(callback, data...)
	_closures[id] = cl
	return uint(C._g_timeout_add_seconds_full(C.gint(priority), C.guint(interval), C.gint64(id)))
}