mirror of
https://github.com/mappu/miqt.git
synced 2025-01-08 16:38:37 +00:00
goroutine6: use mainthread.Wait() helper function
This commit is contained in:
parent
f71dc1c303
commit
e347084d94
@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
"github.com/mappu/miqt/qt6/mainthread"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -39,8 +40,11 @@ func main() {
|
||||
var tick int
|
||||
for range time.NewTicker(time.Duration((index+1)*25) * time.Millisecond).C {
|
||||
tick++
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
// time.Sleep(50 * time.Millisecond)
|
||||
|
||||
mainthread.Wait(func() {
|
||||
qlabel.SetText(fmt.Sprintf("%v %v", tick, time.Now().UTC().Format("15:04:05.0000")))
|
||||
})
|
||||
}
|
||||
}(i, label)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user