This is hard to explain so here it is with code:
int theVariable;
setVariable(theVariable, 10);
void setVariable(variableName, variableContents){
variableName.setValue(variableContents);
}
I am making a library for settings and when I call addTextField()
I want to be able to pass a variable name so when you change the text field, that variable is auto-set. I was thinking reflection, but I am not sure if that is the way to go.
Aucun commentaire:
Enregistrer un commentaire