test BlockDelay effect

This commit is contained in:
cuu 2018-06-19 15:23:59 +08:00
parent 238e250499
commit 01237d9f65
4 changed files with 5 additions and 4 deletions

BIN
main

Binary file not shown.

View File

@ -56,10 +56,9 @@ func run() int {
} }
if ev.Type == event.USEREVENT { if ev.Type == event.USEREVENT {
fmt.Println(ev.Data["Msg"]) fmt.Println("UserEvent: ",ev.Data["Msg"])
} }
if ev.Type == event.KEYDOWN { if ev.Type == event.KEYDOWN {
fmt.Println(ev)
if ev.Data["Key"] == "Q" { if ev.Data["Key"] == "Q" {
main_screen.OnExitCb() main_screen.OnExitCb()
return 0 return 0

View File

@ -387,10 +387,10 @@ func (self *MainScreen) RunEXE( cmdpath string) {
self.DrawRun() self.DrawRun()
self.SwapAndShow() self.SwapAndShow()
time.Delay(1000)
time.BlockDelay(1000)
cmdpath = strings.Trim(cmdpath," ") cmdpath = strings.Trim(cmdpath," ")
cmdpath = CmdClean(cmdpath) cmdpath = CmdClean(cmdpath)
event.Post(event.RUNEVT,cmdpath) event.Post(event.RUNEVT,cmdpath)

View File

@ -381,9 +381,11 @@ func (self *Page) AdjustSAutoLeftAlign() { // ## adjust coordinator and append
it.SetParent(self) it.SetParent(self)
it.SetIndex(i) it.SetIndex(i)
it.Adjust(start_x+i*self.PageIconMargin + i*IconWidth, start_y, IconWidth-6, IconHeight-6, 0) it.Adjust(start_x+i*self.PageIconMargin + i*IconWidth, start_y, IconWidth-6, IconHeight-6, 0)
old_surf := it.GetImgSurf() old_surf := it.GetImgSurf()
it_w,it_h := it.Size() it_w,it_h := it.Size()
it.SetImgSurf( transform.SmoothScale( old_surf, it_w,it_h)) it.SetImgSurf( transform.SmoothScale( old_surf, it_w,it_h))
} }
} }