Forum Discussion

cpawinsal's avatar
cpawinsal
Visitor
16 years ago

Screen Pops but lose control

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?

13 Replies

  • One of the users here posted an emacs minor-mode. I'm using it. If I had good command of Emacs, it would not be so bad. But, try cutting and pasting in that thing. And, if you are a shortcut lover, forget about it. I can't tell you how many times I hit ctrl v and wound up down a the bottom of the page. Or select, cut, select text to copy over, paste and the text you cut does not show up... it makes a copy of the text you just highlighted. Unix freaks.

    BTW, Kevin, I know now that there's no problem with using one thread and in fact that makes a lot of sense. In lieu of any discussions regarding threading, how about a troubleshooting section of the typical problems (if you're seeing this... you may consider trying this). Nonetheless, it works, it's cool, it's even fun despite some of the tools I'd like to have. I'm sure that's just around the corner though.

    Cheers,
    Al
  • It's just a matter of bypassing your ingrained conceptions about how cut and paster are supposed to behave. Which is hard, I imagine. I'm lucky enough to have used vi/vim for a long time.

    The thing with vim and Emacs is that you can be amazingly productive with them when you know all the commands/shortcuts or define your own. If I have to move a hand from the keyboard while coding, my editor has failed me.
  • "cpawinsal" wrote:
    BTW, it would be nice if someone opened up an open source project on the SDK. An eclipse plug in or perhaps a java API that outputs members as BrightScript or xml instantiation or anything with an IDE. About 90 percent of my problems were mispellings that are not caught until compile (as well as type declarations ";" at the ends of my calls... lol). Plus, writing in Emacs (better than nothin') is miserable for me.

    You might want to check this out: viewtopic.php?f=34&t=31199
    It's probably not as feature rich as you're actually talking about, but it's a good start: