Delete TextLabels during runtime (controlP5)
in
Contributed Library Questions
•
6 months ago
I hope this is in the right place, then again this one might be a general programming mistake rather than asking how to use controlP5..
When the number of boxes gets bigger all is well (except for the error that says "controller with name 'blaar' already exists" but that's because I'm re-drawing all of them everytime and because I can't work out how to delete them I get that warning).
Now, when I reduce the number of boxes the labels stay there. Because (I think) there's no way of deleting an instance in Java.
Any ideas?
I have a box which is populated with data in the form of textlabels. The number of boxes needs to change as and when new devices come online or go offline.
I currently start by declaring in my setup that updateboxes=1;
Then this is in Draw:
- if(updateboxes=1){
- while(i<numberofboxes){
- arrayofboxes[i]=new box(positioninginfo,i); //i gives each label inside each box an id relating to its box.
- }
- updateboxes=0;
- }
Now, when I reduce the number of boxes the labels stay there. Because (I think) there's no way of deleting an instance in Java.
Any ideas?
1