How to get acces to a GUI in C++ class
by Gregory · in Torque 3D Professional · 11/17/2011 (7:55 am) · 2 replies
Hi,
How can i get a pointer to one of my GUI everywhere in the C++ ?
Something like that:
GuiControl* myGUI = AllGUIManager->GetByName("MyControlName");
Thanks
How can i get a pointer to one of my GUI everywhere in the C++ ?
Something like that:
GuiControl* myGUI = AllGUIManager->GetByName("MyControlName");
Thanks
Associate Fyodor -bank- Osokin
Dedicated Logic
GuiControl * myGui = NULL; if(!Sim::findObject("MyControlName", myGUI)) { Con::errorf("Can't find it!"); return; } Point2I pos = myGui->getPosition();orGuiControl * myGui = dynamic_cast<GuiControl *>(Sim::findObject("MyControlName")); if(myGui == NULL) { Con::errorf("Can't find it!"); return; } Point2I pos = myGui->getPosition();Gui names are the "public" names for whole SimObject "family". And it should be unique.
You can't do this: