def delete_widget( self, widget_id ) :
        """Delete a widget from a menu. Menu must not be posted when
        this is called.
        Arguments: widget id
        Returns: 0 on failure, 1 on OK"""

        # don't delete anything from an active menu
        if self.is_posted :
            return 0

        # removing it from the list of dictionaries is sufficient
        for i in range( len( self._wdicts ) ) :
            if self._wdicts[ i ][ 'widget_id' ] == widget_id :
                self._wdicts[ i : i + 1 ] = []
                return 1

        return 0
Delete a widget from a menu. Menu must not be posted when
        this is called.
        Arguments: widget id
        Returns: 0 on failure, 1 on OK
recipes/Python/442500_ExtraMenu__TkInter_menu_arbitrary_widgets/recipe-442500.py