mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-13 08:28:51 +01:00
create events under UI
This commit is contained in:
parent
c4bfb007eb
commit
0a1944ef80
4
main.go
4
main.go
@ -47,6 +47,8 @@ func run() int {
|
|||||||
|
|
||||||
fmt.Println(main_screen)
|
fmt.Println(main_screen)
|
||||||
|
|
||||||
|
event.AddCustomEvent(UI.RUNEVT)
|
||||||
|
|
||||||
running := true
|
running := true
|
||||||
for running {
|
for running {
|
||||||
ev := event.Wait()
|
ev := event.Wait()
|
||||||
@ -65,7 +67,7 @@ func run() int {
|
|||||||
}else if ev.Data["Key"] == "D" {
|
}else if ev.Data["Key"] == "D" {
|
||||||
time.Delay(1000)
|
time.Delay(1000)
|
||||||
}else if ev.Data["Key"] == "P" {
|
}else if ev.Data["Key"] == "P" {
|
||||||
event.Post(event.RUNEVT,"GODEBUG=cgocheck=0 sucks") // just id and string, simpify the stuff
|
event.Post(UI.RUNEVT,"GODEBUG=cgocheck=0 sucks") // just id and string, simpify the stuff
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
main_screen.KeyDown(ev)
|
main_screen.KeyDown(ev)
|
||||||
|
|||||||
6
sysgo/UI/events.go
Normal file
6
sysgo/UI/events.go
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package UI
|
||||||
|
|
||||||
|
|
||||||
|
const (
|
||||||
|
RUNEVT=1
|
||||||
|
)
|
||||||
@ -393,7 +393,7 @@ func (self *MainScreen) RunEXE( cmdpath string) {
|
|||||||
cmdpath = strings.Trim(cmdpath," ")
|
cmdpath = strings.Trim(cmdpath," ")
|
||||||
cmdpath = CmdClean(cmdpath)
|
cmdpath = CmdClean(cmdpath)
|
||||||
|
|
||||||
event.Post(event.RUNEVT,cmdpath)
|
event.Post(RUNEVT,cmdpath)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
test.go
2
test.go
@ -106,7 +106,7 @@ func run() int {
|
|||||||
time.Delay(1000)
|
time.Delay(1000)
|
||||||
}
|
}
|
||||||
if ev.Data["Key"] == "P" {
|
if ev.Data["Key"] == "P" {
|
||||||
event.Post(event.RUNEVT,"GODEBUG=cgocheck=0 sucks") // just id and string, simpify the stuff
|
event.Post(event.RUNEVT,"GODEBUG=cgocheck=0 sucks") // just id and string, simplify the stuff
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user