I'm using ControlP5 textfields to add a text input in my program. I'm using a controlFont to change the pixel font used to display the text in the textfield, and until a few days ago it worked fine. I just updated the ControlP5 library and after the update, the text that I write in the textfield is no longer visible. The cursor moves and the text that I write is saved in my string, but it's just not visible in the textfield. I guess the color of the text is set to be the same as the background or something like that.
I have tried setColor(), setColorLabel() and various other functions but nothing seems to work. I use controlP5.setControlFont(labelFont) to set the controlFont for all my controllers but it's only inside the textfield that it doesn't work, everywhere else the labels are visible and white as they should be.
This is the code I use. I call controllerSetup() in my setup() function. The program has grown rather big so I have tried to only show the code that is relevant for this post.
I have a problem with a sketch I'm working on. It's a program that will take a word from a .csv file, then use that word to search for pictures on Google and retrieve the resulting html file for parsing.
The code I have so far is this. It's been modified slightly for your viewing pleasure.
String[] google_csv;
String[] result_line;
String[] result_words;
String[] search_result;
String[] html;
String final_result = "";
String url;
void setup() {
//html = parse_html(parse_csv()); //This is the normal call
html = parse_html("searchword"); //This call will work without the .csv file
}
//Nothing in the draw function for now---------------------------------------------------------------------
void draw() {
}
//The function to parse the .csv file----------------------------------------------------------------------
String parse_csv() {
google_csv = loadStrings("report.csv");
result_line = split(google_csv[60], ',');
result_words = split(result_line[0], ' ');
for(int i = 0; i < result_words.length; i++) {
final_result += result_words[i];
if(i < (result_words.length - 1)) {
final_result += "+";
}
}
return final_result;
}
//The function to fetch and parse the html file with the search results-----------------------------------
String[] parse_html(String word) {
url = "http://images.google.com/images?hl=da&biw=1166&bih=706&tbs=isch%3A1%2Cisz%3Al%2Citp%3Aphoto&sa=1&q=%22" + word + "%22&aq=f&aqi=g10&aql=&oq=";
search_result = loadStrings(url); //This is where it fails to find the URL
return search_result;
}
When the loadStrings(url) call is made towards the bottom it returns this error:
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at java.net.URL.openStream(URL.java:1010)
at processing.core.PApplet.createInputRaw(PApplet.java:4532)
at processing.core.PApplet.createInput(PApplet.java:4500)
at processing.core.PApplet.loadStrings(PApplet.java:4785)
at sketch_mar31a.parse_html(sketch_mar31a.java:62)
at sketch_mar31a.setup(sketch_mar31a.java:32)
at processing.core.PApplet.handleDraw(PApplet.java:1583)
at processing.core.PApplet.run(PApplet.java:1503)
at java.lang.Thread.run(Thread.java:680)
The file "http://images.google.com/images?hl=da&biw=1166&bih=706&tbs=isch%3A1%2Cisz%3Al%2Citp%3Aphoto&sa=1&q=%22searchword%22&aq=f&aqi=g10&aql=&oq=" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
I know the url is valid, because if I cut the url from the error report and paste it in the browser it works.
What gives? Have I missed something obvious? (I'm kinda new to this)