Proccessing issues in ICalico

Issue #160 resolved
Keith O'Hara created an issue

These notebooks have issues:

  • Week11/noise.ipynb OK
  • Week08/imageExample3.ipynb OK
  • Week07/sun.ipynb OK
  • Week06/textSki.ipynb OK
  • Week05/happyFace.ipynb OK
  • Week04/keysTest.ipynb --------- FAIL

Comments (26)

  1. Doug Blank

    Started branch processing-invoke; have identified issues: user-called functions need protection, internal ones do not need nested Invokes

  2. Keith O'Hara reporter
    let mutable sx = 0.0    // x position
    let mutable sy = 0.0    // y position
    let mutable vx = 1.0    // x velocity
    let mutable vy = 1.0    // y velocity
    let mutable ay = 0.2    // y acceleration (gravity)
    
    Processing.window(500, 500)
    Processing.fill(255., 0., 0.)
    Processing.smooth()
    
    let draw() = 
        sx <- sx + vx
        sy <- sy + vy
        vy <- vy + ay
    
        if sx <= 0.0 || sx >= Processing.width() then vx <- -vx
    
        if sy >= (Processing.height()-10.0) then 
            sy <- (Processing.height()-10.0)
            vy <- -0.9*vy
    
    Processing.background(255.)
    Processing.ellipse(sx, sy, 20., 20.)
    
    Processing.add_onLoop (new Processing.VoidDelegate (draw))
    Processing.loop()
    
  3. Keith O'Hara reporter

    Looks like the Event handlers (mousePressed etc.) are causing the trouble. Strange since onLoop also functions as an event handler.

  4. Keith O'Hara reporter

    And I bet errors in the event handlers are also not being shown. For example, in the textSki example.

  5. Keith O'Hara reporter

    Also seems like if the frameRate is set too high (the draw() method can't keep up) the sketch locks up.

  6. Keith O'Hara reporter

    I think 2607aef fixes the threading issues (if it really does, we should change get() back to the previous version).

    Still no idea why things aren't being displayed/printed from the event handlers though. Maybe the GUI's IO is being redirected via ipython.

  7. Keith O'Hara reporter
    • changed status to open

    Things are still not being displayed/printed from the event handlers. Maybe the GUI's IO is being redirected via ipython. (Also errors are silently handled, maybe stderr is also redirected?)

  8. Keith O'Hara reporter

    This is also a problem in Graphics event handlers:

    from Graphics import *
    
    window = makeWindow("Title", 100, 100)
    
    def handleMouseUp(obj, event):
        print("Up")
    
    window.onMouseUp(handleMouseUp)
    
  9. Keith O'Hara reporter

    I think the trouble is that the output isn't attached to any cell, so it's not be properly displayed by the notebook. It looks like the message is indeed getting sent to the front-end.

  10. Doug Blank

    There was a related issue for IPython that I reported and is fixed in IPython 2.1.0. Can you update and try that?

  11. Log in to comment