How to check for existence of G4P GUI before calling CreateGUI(); ?
in
Contributed Library Questions
•
1 year ago
My application restarts when a "restart" button is clicked. The restart basically resets all global variables and arrays and then runs Setup() again. This works fine for my needs except that within Setup() is the statement CreateGUI() to create the G4P GUI elements. Since I'm using G4P's floating panel the net result is another instance of this panel every time restart is clicked (and Setup() is run again). I suspect that the entire G4P interface is replicated, but the only visible issue is the multiple floating panels as they all can be opened/closed/dragged independently. I'd prefer to only initiate G4P if it doesn't already exist.
Is there a G4P property I can check for to see if it's already there (exists) before calling CreateGUI() ? I'm not seeing an obvious candidate in the library's reference docs.
In essence, something like.....
if (G4P.exists == true){
CreateGUI();
}
Thx in advance
1