Hi ROOTers,
I am working on a GUI for CAEN Digitizer and it is necessary to have a reliable error handling.
Particularly, If an error occurs I popup a dialog window (see pic). For several reasons I need to force focus on that popup error window until OK button clicked. So is there a simple way to do that? Of course, I could write a function that would disable all widgets on a background window but it is not very good solution.
UPDATE
Here is my implementation of error dialog. It is a class named ErrorDialog
. I think its constructor explains what is going on.
ErrorDialog::ErrorDialog( const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h, const caenoo::CAENException& e, const std::string &msg )
{
fMainFrame = new TGTransientFrame( p, main, w, h );
fMainFrame->Connect( "CloseWindow()", "ErrorDialog", this, "CloseWindow()" );
fMainFrame->DontCallClose();
fMainFrame->SetCleanup( kDeepCleanup );
//Create button and text
CreateBottomFrame();
CreateInfoFrame( e, msg );
fMainFrame->MapSubwindows();
fMainFrame->Resize();
// position relative to the parent's window
fMainFrame->CenterOnParent();
fMainFrame->SetWindowName("Error");
fMainFrame->MapWindow();
}
ROOT Version: 6.04.00
Platform: SL7
Compiler: gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)