def setModal(self, element):
        '''The element will capture all input.

        setModal(None) to clear.
        '''
        if element is None:
            for child in self.children:
                child.is_enabled = True
                child.is_modal = False
        else:
            found = False
            for child in self.children:
                if child is not element:
                    child.is_enabled = False
                else:
                    found = True
                    child.is_modal = True
            assert found, '%r not found in gui children'%(element,)
dataset/ETHPy150Open ardekantur/pyglet/contrib/wydget/wydget/event.py/GUIEventDispatcher.setModal/original