Forum Discussion

eockh's avatar
eockh
Visitor
14 years ago

roImageCanvas not closing

I have the following navigation stack in my channel: (roGridScreen -> roScreen -> roImageCanvas)

When I exit the roImageCanvas screen I call (close()) and set the reference to invalid. However when I exit the roScreen, the channel displays the roImageCanvas for a moment before displaying the roGridScreen. I have also tried the following code in an effort to at least clear the screen to black and I still get the artifacting:

canvas.allowupdates(true)
canvas.purgecachedimages()
canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
canvas.SetLayer(1, {Color:"#FF000000", CompositionMode:"Source"})
canvas.show()
canvas.close()
canvas = invalid

Any ideas why the image canvas is not destroyed?

2 Replies

  • Try adding a short Sleep() immediately after closing the canvas. Show and Close aren't synchronous, so it may be that the canvas doesn't have sufficient time to close before you open the roScreen. It could also be an anomaly with roScreen that's related to this statement in the SDK documentation:
    "http wrote:
    Once an roScreen is created, the display stack enters "Game Mode", and other screen components cannot be used. Other screen components cannot be intermixed with roScreens as the roScreen display stack is maintained independently from the main screen component display stack.
  • The sleep was it..... Sleep(50) seemed to be sufficient. Thanks!