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