I am a ROOT newcomer. I am building a GUI application with numerical entries. Since I get more than 40 input fields, I have created a map<string, int> in order to iterate. That works: it creates the widgets I need, and I am able to pass the numerical value of the TGNumberEntry to a trivial “echo” void “PrintOut” via
val=num_widget->GetNumberEntry()->Connect(“TextChanged(char*)”, “myclass”,gApplication, “PrintOut(char*)”);
It gets nicely the updated numerical value, but I do not know hot to tell “PrintOut” what TGLabel it was related to. My first idea was to add a string or char argument to “PrintOut”. It did not work.
But maybe there’s a more clever and compact way to deal with a great number of identical (integer) entries? All I want is to pass all the updated entries to another part of the program, without defining all fields one by one. Maybe having
num_widget->SetName(var_label);
helps? I cannot take advantage of it. I have checked several GUI tutorials but did not find anything in the direction I am looking for.
Thanks!
Giovanni