We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi I'm using the G4P library for a GUI inteface that must show some data coming via serial . I don't have problems to write value inside the texfield using data that are inside a byte[] using the below instructions:
String sonda_F1= str(char(inBuffer[42]))+str(char(inBuffer[44]))+str(char(inBuffer[46]))+str(char(inBuffer[48]));
textfield1.setPromptText(sonda_F1); **
I've problems when I try to read what I wronte inside the textfield1 as follow :
String my_datatxt = textfield1.getText();
println("My data :" my_datatxt);**
The output show just "My data :"
I've used the same method with a lable and lable11.getText() has worked fine , Where I'm wrong ?? :(
And another thing... assuming that I'm able to read the content of textfield1 and I got a value like this "1234", how can I split these in for different character to be store inside 4 location of a byte[] ?
Thanks since now for any suggestion ! :D
Answers
http://forum.Processing.org/two/discussion/8045/how-to-format-code-and-text
Do not use the
setPromptText
usesetText
instead i.e.The prompt text is displayed inside a GTextField when it is empty of user text and is displayed in italic text.
getText
does NOT return the prompt text, it returns the text typed in or entered usingsetText
Thank you quark ! Is there any easy tutorial available for the G4P library available on the web ? Thanks. Roberto.
Only what you can find on my website. The library comes with many examples which should give you an idea of the features available for each control.