Search code examples
javauser-interfaceprocessingcontrol-p5

Multiple instances of eventControl not detecting all events


I have ControlP5 running on the main frame. And I also have two additional frames using ControlP5, they are contained in a class that extends PApplet. Like the example - http://www.sojamo.de/libraries/controlP5/examples/extra/ControlP5frame/ControlP5frame.pde

They all display fine, and seem to be working. But then clicking a button does nothing, it doesn't even highlight when you mouse over it. So I'm assuming the controlEvent function for those classes isn't being called.

The main frame contains a ControlP5 declaration in the setup, and has a controlEvent function in the main pde file. That handles the buttons pressed on the main frame perfectly well. But then when you click the buttons to initiate one of the additional frames, the frame loads fine and displays the buttons located on it, but they don't do anything when clicked. Nor do they look like buttons as they don't highlight like the buttons on the main frame do.

I'm not sure what exactly is wrong, as there are multiple instances of controlEvent, although one in the main file and the other two inside a class. Does anyone have any ideas as to why the events aren't being picked up on the additional frames? (I would've included the code, but it's really long and could overcomplicate things).

Thanks.


Solution

  • In case anyone views this to find an answer, I just used G4P in unison. It was annoying having two different GUI packages, but it did work.