Yet another noob question, I know, I am sorry. *bows ashamed*
I have a GUI in my application now, including some nice window hovering above the main view and displaying some information. Since that information is passed using pointers, it is crucial to make them NULL when user closes the window. My question is :
- how to catch that event (of closing the window, that is) in order to nullify the pointers?
I checked API and the enumeration of event types and I haven't found it (maybe I missed it?). I thought about using general IGUIWindow destructor, but this is not the nicest solution (to use class destructor in order to invalidate some particular pointers).
Do you know how to do that?
I will be very grateful for answers.
How to catch event of closing IGUIWindow?
Ouch! So no other way than to implement it by myself? Awww....
But then again, maybe there is some way to block closing of the GUIWindow?
This data is necessary for the program user (it is moreor less scientific program), and it is more convenient to have it in the floating window than some fixed toolbar?
But then again, maybe there is some way to block closing of the GUIWindow?
This data is necessary for the program user (it is moreor less scientific program), and it is more convenient to have it in the floating window than some fixed toolbar?
I have found solution to my problem, which I give here, even though it is only fit to my particular application (but maybe someone will find it useful).
Before actually sending any data to the toolbox display via pointers, the program simply checks if such an element exists :
Sorry to have been bothering you!
Before actually sending any data to the toolbox display via pointers, the program simply checks if such an element exists :
Code: Select all
IGUIElement* toolbox = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(5000, true); //5000 is the toolbox id, same as in MeshViewer application example
if (toolbox ){ then do something}
Even better:
Then, in your event receiver, you can check and see if it's that button or not and do your cleanup code.
Code: Select all
s32 closeButtonId = Window->getCloseButton()->getId();
-
- Posts: 370
- Joined: Mon Aug 29, 2005 10:54 pm
- Location: http://web.utk.edu/~pfox1
Another option you have if you want to get rid of that button completely is:
No more close button! I had a window creation function that would automatically do this, and add a Hide Window button to each window instead, to avoid having to re-create the window every time.
Code: Select all
Window->getCloseButton()->setVisible(false)