Move message dialog handling around
This commit is contained in:
parent
aaa54a1f37
commit
ad4ffe326d
|
@ -1,11 +1,19 @@
|
|||
sub init()
|
||||
m.top.observeField("buttonSelected", handle_button)
|
||||
end sub
|
||||
|
||||
function onKeyEvent(key as string, press as boolean) as boolean
|
||||
if key = "OK"
|
||||
m.top.close = true
|
||||
m.top.buttonSelected = 0
|
||||
handle_button()
|
||||
return true
|
||||
end if
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
function handle_button()
|
||||
' We just toggle the close state, so subsequent touches don't do anything funny
|
||||
m.top.close = true
|
||||
m.top.close = false
|
||||
end function
|
||||
|
|
|
@ -43,11 +43,5 @@ function message_dialog(message="" as string)
|
|||
dialog.message = message
|
||||
|
||||
m.scene.dialog = dialog
|
||||
m.scene.dialog.observeField("buttonSelected", handle_dialog)
|
||||
m.scene.dialog.setFocus(true)
|
||||
end function
|
||||
|
||||
function handle_dialog(msg)
|
||||
print("THERE")
|
||||
m.scene.dialog.close = true
|
||||
end function
|
||||
|
|
Loading…
Reference in New Issue
Block a user