I am trying to pop screens (per the API example) and am getting mixed results. Can someone please help me out. This seems to be the last issue I need to overcome with the player.
Function popAndShow(screenArray As Object) As Void
screenToClose = screenArray.Pop()
screenToShow = screenArray.GetEntry(screenArray.Count() - 1)
screenToClose.Close()
screenToClose = invalid
screenToShow.Show()
End Function
Assume a simple case where I have screen A that is a home screen and it can invoke screen B. The user wants to close screen B. Screen B should close, screen A should now be open. I do this, and I have an "exit while" statement in my event handler in B. Yet, while I can go from B to A, I can not then go anywhere else as I have lost focus and can't get it back. Can someone help me see the light please?
screen a = createObject("roPosterScreen")
screenArray = createObject("roArray", 1, true)
screenArray.push(a)
...
while true
msg = wait(0, a.getMessagePort())
... can't close this screen so just do what the user asks when the user is here.
... user wants screen b so...
b.show()
erstwhile...
screen b = blah, blah
screenArray.push(b)
while true
msg = wait(0, b.getMessagePort()) 'port is the same as a's
if msg.isScreenClosed()
popAndShow(screenArray)
exit while
I find that the above will take me back to the screen I want to go to. However, it will just not give me focus back. Can someone help please?