def RemoveChild(self, child):

        # Remove all references to the child from the collapse stack
        count = len(self._collapse_stack)
        src = dst = 0

        while 1:

            item = self._collapse_stack[src]

            if item == child:
                src += 1
                if src == count:
                    break

            if src != dst:
                self._collapse_stack[dst] = item

            src += 1
            dst += 1

            if src == count:
                break

        if src > dst:
            self._collapse_stack = self._collapse_stack[
                0:dst] + self._collapse_stack[src:]

        # ... and then proceed as normal
        RibbonControl.RemoveChild(self, child)
    def RemoveChild(self, child):
        """ Remove all references to the child from the collapse stack. """

        try:
            self._collapse_stack.remove(child)
        except ValueError:
            pass

        # ... and then proceed as normal
        RibbonControl.RemoveChild(self, child)
Exemple #3
0
    def RemoveChild(self, child):

        child.Bind(wx.EVT_ENTER_WINDOW, None)
        child.Bind(wx.EVT_LEAVE_WINDOW, None)

        RibbonControl.RemoveChild(self, child)