We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey!
I have created a text area under G4P GUI builder (updated to the latest versions)...But when I append text to display on the text area, the next line character "\n" is not processed and continues to append in the same line...Code is something like this under a button event...
public void acceptLogin_click(GButton source, GEvent event){
mymonitor_textarea.appendText("Test text...\n");
}
But the string is appended immediately and not in the next line...
The output on the textArea when I click the button appears like this
Test text...Test text...Test text...
and not
Test text...
Test text...
Test text...
Any help is appreciated!
Answers
Not an ideal solution but this shows how you might work round the problem
@quark, I tried this, the new line problem was fixed, but this rendered the text area to be unscrollable, scroll bars arent working in the textarea even though the scroll is enabled
I will fix this in the next version of G4P at the moment there is no work arround. Sorry.
The method you suggested is spitting out nullpointer exceptions when I click the scroll bars...So setText(getText()+something) is not good for making something like a real time monitor...
Sorry about that, the GTextArea control is by far the complex control to code and I know there are some issues with it. I am looking at a complete refactoring of the code for all editable text controls but this is going to take a long time before it becomes available.
As a workaround for those who didn't seem to overcome this issue, try this
This sounds dumb, but gets the job done...