Move message dialog handling around

This commit is contained in:
Nick Bisby 2019-10-14 11:56:22 -05:00
parent aaa54a1f37
commit ad4ffe326d
2 changed files with 9 additions and 7 deletions

View File

@ -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

View File

@ -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