what is the correct way to call a contributed library or class inside a subclass?
in
Programming Questions
•
1 year ago
Hi,
This is a question for someone that knows processing:
What is the correct way to call any class inside a class?
Because the programs (contributed library and examples start to fail when are called from a seconday level.
saying that something is not constructed in the contributed library,etc.
I have tried with this, and new the class(this) , but it also fails when it is called in a sub/sub level. ( 'this' works for the first level, but not for the sub levels')
Maybe is something related with PApplet but I tried extending PAppet and didn't work. and I don't find and example that works in a third sub level or higher...
The point: to have a menu, that calls different submenus(sketches) and those have submenus that do something .
how to call correctly a class in a sub/sub/sub level?
example of the problem:
void draw{ //first level
menu();
}
public class menu extends guicomponents { //second level
menu{}
void setup()
{ graphics(); //or any other one
}
}
public class graphics extends guicomponents { //third level , tried also with PApplet,etc :(
void setup();
call_any_contributed_library() <---- here calling the contributed libraries causes errors,
call_any_contributed_library(this) <---- also tried with this,
At this level the libraries chage their behavior, like ControlP5,guicomponents,
unfolding,etc. The libraries start to say that component is undefined, or crashing,
or hanging., and the examples from processing and open processing fails when code is called at this level or in a deeper level.
}
How to call the libraries correctly from a class inside a class?
thank you
1