We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi dudes! I'm a new user of this forum and i hope to help you in the future. But now I need an help...or i cannot continue my Processing project :P
I download the g4p library and my aim is to create a simple program: once insterted the text into the text area if you push a button you could store this text in a String/Array.
I thought it was easy but I don't understand why i cannot insert in function like
void handleButtonEvents (GButton button, GEvent event)
a new (GTextArea) argoument, because if I insert this, the function stop working.
Do you know how to solve this problem anyhow?
P.S. Sorry for my bad english :(
Answers
void handleButtonEvents (GButton button, GEvent event)
is called the method signature. This one defines a method called
handleButtonEvents
that requires two parameters, aGButton
and aGEvent
in that order.When G4P detects a click on a button it will look for a method with this signature so if you simply add another parameter then you are changing the signature and G4P will not find the function.
Here is a simple demo of how to do what you want. The code should be self explanatory.
import g4p_controls.*;
My mistake was to contract
GTextArea txa = new GTextArea(this, 10, 20, 180, 170, G4P.SCROLLBARS_BOTH);
into the setup.Thank you so much! :D