G4P: textField on-click Event
in
Contributed Library Questions
•
1 year ago
Hello,
I have a GTextField that works just fine, using G4P, but I would like to place the text explaining what it is for inside the textField. Then, when the user clicks in the field to type some text, I would simply remove the default text. Unfortunately, I don't see an on-click type of event. Currently, only key presses trigger an event for me.
For example, I want the textField to display 'Search' initially. Then, when the user clicks to get focus, I was hoping to catch an event so I could remove the text if it matched 'Search'. I realize you could not search for Search, but that is not an expected use case for this textField.
I know I could use a combination of isOver() and the mousePressed callbacks built into Processing to implement this, but it would be nice if G4P had a CLICKED event that triggered a call to the eventHandler.
Hopefully my questions are not too bothersome. I like G4P and maybe some of these will help make it even better.
Thanks in advance,
bbc
1