this is probably a trvial question, but I’d like to know how to set the focus to a TGInputDialog. When running the routine (normal ROOT macro, not in context of a TApplication or so)
I still need to click inside the text field to start typing. Is there a way to set the focus automatically to the TGTextEntry? Or is there even a better way to request user input in a “normal” non-GUI ROOT macro?
Best regards and thanks,
Klaus
ROOT Version: 6.36 Platform: Debian Linux 12 Compiler: Not Provided
Note that you can use the dialogs from macros/Dialogs.C and add a line to set the focus on the text input, like for example:
InputDialog::InputDialog(const char *prompt, const char *defval, char *retstr)
{
[...]
// popup dialog and wait till user replies
fDialog->MapWindow();
// set the focus to the text input
gVirtualX->SetInputFocus(fTE->GetId());
[...]