Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Events with two windows using ControlP5 + Processing 3

$
0
0

Hi. I have a project wich runs in two windows. One is intended to control the other. So, in the first one I'm drawing CP5 controls. But I'n not being able to handle the events in the second window. I mean, I don't know how to capture events in a second window.

Default code would be: cp5.addToggle("toggleValue")

Well, that tries to resolve the event in the same window.

I can see you can pass a misterious object as first param, so I tried things like: cp5.addToggle(secondWindow, "toggleValue")

But that wont work either. The error is always this: Exception in thread "Thread-2" java.lang.NullPointerException

I think is previous versions one could create windows using controlWindow. Not sure. I'm using processing 3. And I'm creating the windows myself (in Eclipse context)

So, any clue on how to define a event listener or something like that?

Thanks in advance.


Viewing all articles
Browse latest Browse all 2896

Trending Articles