Split into category packages; module github.com/ZacharyZhang-NY/MujicaUI
This commit is contained in:
1822 files changed
+24568
-21314
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package overlay
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/egoist/mygo/ui"
|
||||
)
|
||||
|
||||
// overlayUntil draws frames until cond holds, for at most 5 s of wall time.
|
||||
func overlayUntil(tt *ui.Tester, cond func() bool) bool {
|
||||
end := time.Now().Add(5 * time.Second)
|
||||
for !cond() {
|
||||
if time.Now().After(end) {
|
||||
return false
|
||||
}
|
||||
time.Sleep(2 * time.Millisecond)
|
||||
tt.Frame()
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in new issue
Block a user