Forum Discussion

jeremyk's avatar
jeremyk
Visitor
15 years ago

Code related to back button implementation?

I am looking at implementing the Back Button code (EnableBackButton) and having no luck at all. Anyone willing to share their implementation or have a simple way to explain the implementation? I don't see any sample code that shows this actually working.

Thanks!

4 Replies

  • Where specifically are you trying to implement it? The back button functionality is automatic on all screens except the roImageCanvas and the roMessageDialog(s). On the roImageCanvas, you just need to look for the isRemoteKeyPressed event with an index of 0, and on the message dialogs, you just need to call the EnableBackButton() method you mentioned in your post.
  • Thanks for the quick response. In my case it is just roMessageDialog then, so when I create the object do I just set EnableBackButton and then when the user hits the button it returns isScreenClosed() just like normal? For example:

    dialog = CreateObject("roMessageDialog")
    dialog.EnableBackButton(True)

    And thats it?
  • I've never actually used it on the roMessageDialog, but yes, I believe that's how it works. As long as you call .EnableBackButton() before you call .Show(), the user should be able to exit the dialog with the back button.
  • Awesome, thanks for the help, I figured I was overcomplicating it.