Best way to block input from inactive GUIs

Dec 31, 2012 at 12:48 PM
Edited Dec 31, 2012 at 12:51 PM

I have a screen system similar to that in the demos, but I may want to re-use some of the screens ( not to unload everything when it loses focus ).

I have run into a problem by having multiple Gui's that by only updating the one with focus is not enough to block the input from all of the inactive ones. When I move from one screen to another and then click on a space that had a button in the previous screen, the function associated to that button gets called (I'm currently using a delegate to do the call). It would be nice to have some kind of switch in the Gui to make it inactive, blocking all input checking and event generation.

I could of course implement the blocking in my own screen system, but I think it would be much more efficient if done in the GUI itself.

Please let me know if I have missed something obvious.

Coordinator
Jan 16, 2013 at 5:21 PM
Edited Jan 16, 2013 at 5:52 PM

The active flag should prevent a widget and all of its children from firing events. I'll check and see if it does. If so making both visible and active false for a pannel should allow you to hide and block input for all widgets below it on the tree.