'Bind function FUNC to command NAME for this widget.
Return the function bound to NAME if None is given. NAME could be
e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".'

def wm_protocol(self, name=None, func=None):

    if hasattr(func, '__call__'):
        command = self._register(func)
    else:
        command = func
    return self.tk.call('wm', 'protocol', self._w, name, command)
