TGInputDialog

Hello ROOTers,

I would like to use class TGInputDialog but I can not find out how to get the user input. Can you give me an example of using this class?

Thank you!

OldA

Hi OldA,

Below is an example taken from the TGFileDialog class, where the TGInputDialog is used for getting the new directory name:

char answer[128]; strcpy(answer, "(empty)"); new TGInputDialog(gClient->GetRoot(), GetMainFrame(), "Enter directory name:", answer/*"(empty)"*/, answer); while (strcmp(answer, "(empty)") == 0) { new TGMsgBox(gClient->GetRoot(), GetMainFrame(), "Error", "Please enter a valid directory name.", kMBIconStop, kMBOk); new TGInputDialog(gClient->GetRoot(), GetMainFrame(), "Enter directory name:", answer, answer); } if (strcmp(answer, "") == 0) { // Cancel button was pressed } else { // your code here... } Cheers, Ilka