Esempio n. 1
0
func main() {
	icon := trayIconInit()

	glib.TimeoutAdd(UPDATE_TIME*1000, func() bool {
		batteryStatus, batteryPercentage := updateData()
		setTrayIcon(icon, batteryStatus, batteryPercentage)
		return true
	})

	glib.TimeoutAdd(10000, func() bool {
		batteryStatus, batteryPercentage := updateData()
		getRemainingTime(icon, batteryStatus, batteryPercentage)
		return true
	})

	gtk.Main()
}
Esempio n. 2
0
File: idle.go Progetto: leif/go-gtk
func main() {
	glib.IdleAdd(func() bool {
		println("start")
		return false
	})
	glib.TimeoutAdd(1000, func() bool {
		println(fmt.Sprintf("%v", time.Now()))
		return true
	})

	glib.MainLoopNew(nil, false).Run()
}