How to open a second window?

edited June 2016 in Python Mode

I'm working on a project and I need to create a second window. Does anyone know how this can be done?


  • edited December 2017 Answer ✓

    Just gonna re-post what I had already done @ :

     ' RunSketch MultiPApplets (v1.2.2)
     ' GoToLoop (2016-May-06)
     ' size-method-for-intial-window-not-working-
     ' when-more-windows-are-are-added#Item_2
     ' how-to-open-a-second-window#Item_1
    def settings():
        size(500, 500), smooth(3), noLoop()
        global sa, ta
        sa, ta = SecondApplet(), ThirdApplet()
        switches = '--sketch-path=' + sketchPath(), ''
        PApplet.runSketch(switches, sa), PApplet.runSketch(switches, ta)
    def setup(): width == 100 and settings()
    def draw():
        ellipse(width>>1, height>>1, width>>1, height>>1)
    class SecondApplet(PApplet):
        def settings(p): p.size(300, 300), p.smooth(3), p.noLoop()
        def setup(p): p.width == 100 and p.settings()
        def draw(p):
            p.background(-1), p.fill(0)
            p.ellipse(p.width>>1, p.height>>1, p.width>>1, p.height>>1)
    class ThirdApplet(PApplet):
        def settings(p):
            p.size(400, 400), p.smooth(3), p.noLoop()
            print sketchPath(), ENTER, p.sketchPath()
        def setup(p): p.width == 100 and p.settings()
        def draw(p):
            p.background(0), p.fill(-1)
            p.ellipse(p.width>>1, p.height>>1, p.width>>1, p.height>>1)
  • edited June 2016

    It's you again! Thanks a lot. :) Just a little more questions (hope you don't mind).

    1. About your code, I don't quite understand this part:`def setup(p): p.width == 100 and p.settings()` and this:`p.ellipse(p.width>>1, p.height>>1, p.width>>1, p.height>>1)` Can you please explain a bit?
    2. I tried to call p.fullScreen() in the second window, and it worked. But is there a way to turn on fullscreen mode and then turn it off in the second window or in the first sketch window?
    3. When I closed the second window or the third window, the other windows were also closed. Is there a way to keep all other windows open?
Sign In or Register to comment.