how can i pass the main application's 'this' to one class from an inner class class
in
Programming Questions
•
2 years ago
so i have a sketch and i need to pass the 'this' that would apply to the main sketch, however i need to pass it in from an inner class. like this:
- //start of sketch
- void setup(){
- //...code
- }
- void draw(){
- //...code
- }
- class innerClass{
- innerClass(){
- ArrayList list = new ArrayList();
- list.add(new otherClass(this)); //but the 'this' that would be if this statement were in say the setup or draw methods
- }
- }
- class otherClass{
- PApplet parent;
- otherClass(PApplet _parent){
- parent = _parent;
- }
- }
1