We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I have a question about the GTextArea from the G4P library: Is it possible to set the border/stroke width of a GTextArea? If I create a GTextArea, the border/stroke is 5px, but I want that to be 1px.
Thanks in advance Daantje
Answers
Is is not possible for the user to set the border width of a GTextArea.
G4P uses double buffering for all its visual controls to improve efficiency so when you specify the size of the control you are actually specifying the size of the graphic-buffer. This buffer is only updated when the visual representation of the control has to change e.g. mouse moving over a button, a key typed into a text area etc otherwise the buffer is simply copied onto the sketch display.
The 'border' of the GTextArea is simply the background colour used for the buffer and the white area for the text is drawn on top. So one solution is to make the background opaque and draw your own border.
This small sketch shows what I mean
I have designed the drawBorder method so that it can be called from anywhere inside draw without affecting any other drawing commands
That solves the problem :D Thank you very much!!!
Daantje