message: Make the display_window.py example quit after a few loops
diff: @@ -84,21 +84,24 @@ def paint():
  window.after(33, paint)
  # Start on the first drawcall
  -curdraw = 0
  +curdraw = draws[0]
  -# The advance function will be called every 150ms, to move to the next draw
  +loopcount = 0
  +
  +# The advance function will be called every 50ms, to move to the next draw
  def advance():
  - global out, window, curdraw
  + global out, window, curdraw, draws, loopcount
  # Move to the current drawcall
  - controller.SetFrameEvent(draws[curdraw].eventId, False)
  + controller.SetFrameEvent(curdraw.eventId, False)
  # Initialise a default TextureDisplay object
  disp = rd.TextureDisplay()
  # Set the first colour output as the texture to display
  - disp.resourceId = draws[curdraw].outputs[0]
  + disp.resourceId = curdraw.outputs[0]
  + if disp.resourceId != rd.ResourceId.Null():
  # Get the details of this texture
  texDetails = getTexture(disp.resourceId)
  @@ -113,9 +116,18 @@ def advance():
  out.SetTextureDisplay(disp)
  # Set the next drawcall
  - curdraw = (curdraw + 1) % len(draws)
  + curdraw = curdraw.next
  +
  + # If we have no next draw, start again from the first
  + if curdraw is None:
  + loopcount = loopcount + 1
  + curdraw = draws[0]
  - window.after(150, advance)
  + # after 3 loops, quit
  + if loopcount == 3:
  + window.quit()
  + else:
  + window.after(50, advance)
  # Start the callbacks
  advance()
  