Glad you find GUI Builder and G4P awesome, always nice to get positive feedback
So taking each point in turn lets assume we have a GTextArea
called txa
textArea: delete the Text
I assume by this you want to delete all the text in the textarea in which case you can use
txa.setText("");
You can even use an array of empty strings like this
txa.setText(new String[] { "", "" });
but you cannot use an empty array (i.e. a zero length array), this doesn’t work which makes sense to me since you are not providing any Strings to work with.
txa.setText(new String[0]);
The text shown in small textAreas jitters
This is a new one on me and you are the first person to have reported it.
I must ask the question “Why are you using such a small textarea?” since without scrollbars most of the text will be un-viewable anyway, why not use a textfield instead?
Having said that I will investigate the jittering problem further.
Just in case you have further questions I have included here a small test sketch I created to try out some of your issues. You can always modify the main code to demonstrate any issues I have missed.
import g4p_controls.*;
GTextField txf;
GTextArea txa;
GLabel lbl;
GButton btn0;
void setup() {
size(400, 500);
txf = new GTextField(this, 10, 10, 100, 20);
txa = new GTextArea(this, 10, 60, 100, 30);
lbl = new GLabel(this, 10, 120, width - 20, height - 130);
lbl.setOpaque(true);
txf.setText(text2);
txa.setText(text2);
btn0 = new GButton(this, width - 120, 20, 55, 40, "Clear Text");
btn0.addEventHandler(this, "clearText");
btn0 = new GButton(this, width - 60, 20, 55, 40, "Copy Text");
btn0.addEventHandler(this, "copyText");
}
void draw() {
background(200, 200, 255);
}
public void clearText(GButton button, GEvent event) {
txa.setText("");
//txa.setText(new String[0]); // Zero element array doesn't work
//txa.setText(new String[] { "", "" }); // Array with empty strings as elements work
}
public void copyText(GButton button, GEvent event) {
String s = txa.getText();
txa.setText("");
lbl.setText(s);
}
String text0 = "Quark exists";
String text1 = "The rain in Spain falls mainly in the plane";
String text2 = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. "
+ "Lorem Ipsum has been the industry's standard dummy text ever since the "
+ "1500s, when an unknown printer took a galley of type and scrambled it to"
+ " make a type specimen book. It has survived not only five centuries, but "
+ "also the leap into electronic typesetting, remaining essentially unchanged. "
+ "It was popularised in the 1960s with the release of Letraset sheets "
+ "containing Lorem Ipsum passages, and more recently with desktop publishing "
+ "software like Aldus PageMaker including versions of Lorem Ipsum."
+ "Contrary to popular belief, Lorem Ipsum is not simply random text. It has "
+ "roots in a piece of classical Latin literature from 45 BC, making it over "
+ "2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney "
+ "College in Virginia, looked up one of the more obscure Latin words, consectetur, "
+ "from a Lorem Ipsum passage, and going through the cites of the word in classical "
+ "literature, discovered the undoubtable source. Lorem Ipsum comes from sections "
+ "1.10.32 and 1.10.33 of 'de Finibus Bonorum et Malorum' (The Extremes of Good "
+ "and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory "
+ "of ethics, very popular during the Renaissance."
+ "It is a long established fact that a reader will be distracted by the readable "
+ "content of a page when looking at its layout. The point of using Lorem Ipsum "
+ "is that it has a more-or-less normal distribution of letters, as opposed to "
+ "using 'Content here, content here', making it look like readable English. Many "
+ "desktop publishing packages and web page editors now use Lorem Ipsum as their "
+ "default model text, and a search for 'lorem ipsum' will uncover many web sites "
+ "still in their infancy. Various versions have evolved over the years, sometimes "
+ "by accident, sometimes on purpose (injected humour and the like)";