We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hello,
i have been having problems with an application i am building in regards to using cps textfields. it's not a problem i have had in the past, but seems to have changed from a random occurrence to a persistent problem. when i test the cp5 example, it occurred randomly as well, but only one or two times — i can't add as much text as i want in the textfield. when i reach the end of the textfield, i get and array out of bounds error and the sketch freezes. due to other problems i was having, i have now switched back to processing 2.0 (from 2.1 and 2.1.1), which has fixed some of the issues, but i have no idea what is causing this to happen. therefore, i have no idea where to begin to debug it. i have recreated the issue in all of the current processing applications except for 1.5 because i am using pshape and it doesn't work. here is my code:
import controlP5.*;
ControlP5 cp5;
PFont font;
ControlFont cFont;
String recordFileName = "";
void setup()
{
size(500, 500);
cp5 = new ControlP5(this);
font = loadFont("SansSerif-48.vlw");
textFont(font, 32);
cFont = new ControlFont(font, 12);
cp5.addTextfield("recordFileName")
.setPosition(width/2, height/2)
.setSize(160, 20)
.setFont(cFont)
.setFocus(true)
.setColor(color(255))
.setAutoClear(false)
.setCaptionLabel("filename");
}
void draw()
{
background(0);
}
Answers
Hi, could you post the stacktrace of the error message you are seeing? I could not reproduce the error with this wip version (2.1.5).
hi sojamp,
i had a feeling it would be difficult to recreate. the problem just started, it doesn't seem normal and it doesn't happen with the example. this is what prints to the console when i exceed the length of the text box (instead of scrolling the text):
^^^ Bump. I am having the same issue when typing in characters into the textfield very fast. Wonder if a delay is just needed.
This is the error I get sometimes when inputing text into a textfield sometimes.
Anyone know why?