# How to use controlP5 in second window using python mode

**URL:** <https://discourse.processing.org/t/how-to-use-controlp5-in-second-window-using-python-mode/13253>\
**Category:** Processing.py\
**Created:** [August 8, 2019, 10:47am UTC](https://discourse.processing.org/t/how-to-use-controlp5-in-second-window-using-python-mode/13253 "2019-08-08T10:47:19Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 19, 2019, 2:43pm UTC](https://discourse.processing.org/t/how-to-use-controlp5-in-second-window-using-python-mode/13253/6 "2019-08-19T14:43:31Z")

</div>

After creating a more simplified example: 😅

```auto
# https://Discourse.Processing.org/t/
# how-to-using-controlp5-in-second-window-using-python-mode/13253/6

# GoToLoop (2019-Aug-19)

add_library('controlP5')

def settings():
    size(150, 150)
    Other()

def setup():
    ControlP5(this).addBang('Main').onClick(bangCallback)

def draw():
    background(0)

def bangCallback(v):
    print v.controller

class Other(PApplet):
    SW_PATH = '--sketch-path='
    MAGENTA = 0xFFff00ff

    def __init__ (p):
        switches = Other.SW_PATH + sketchPath(), ''
        PApplet.runSketch(switches, p)

    def settings(p):
        p.size(150, 150)

    def setup(p):
        ControlP5(p).addBang('Other').onClick(bangCallback)

    def draw(p):
        p.background(Other.MAGENTA)

```

I’ve just realized the “bug” is due to calling **noLoop()** within SecondApplet::**settings()**: 🐛  
`p.size(300, 100), p.smooth(3), p.noLoop()`

---

_[View the full topic](https://discourse.processing.org/t/how-to-use-controlp5-in-second-window-using-python-mode/13253)._
