(self, index1, index2=None)
Delete menu items between INDEX1 and INDEX2 (included).
Delete menu items between INDEX1 and INDEX2 (included).
Delete menu items between INDEX1 and INDEX2 ( included ) .
def delete(self, index1, index2=None):
        """Delete menu items between INDEX1 and INDEX2 (included)."""
        if index2 is None:
            index2 = index1

        num_index1, num_index2 = self.index(index1), self.index(index2)
        if (num_index1 is None) or (num_index2 is None):
            num_index1, num_index2 = 0, -1

        for i in range(num_index1, num_index2 + 1):
            if 'command' in self.entryconfig(i):
                c = str(self.entrycget(i, 'command'))
                if c:
                    self.deletecommand(c)
        self.tk.call(self._w, 'delete', index1, index2)
def delete ( self , index1 , index2 = None ) : if index2 is None : index2 = index1 num_index1 , num_index2 = self . index ( index1 ) , self . index ( index2 ) if ( num_index1 is None ) or ( num_index2 is None ) : num_index1 , num_index2 = 0 , - 1 for i in range ( num_index1 , num_index2 + 1 ) : if 'command' in self . entryconfig ( i ) : c = str ( self . entrycget ( i , 'command' ) ) if c : self . deletecommand ( c ) self . tk . call ( self . _w , 'delete' , index1 , index2 )