'Toggle the trap flag.'

def _toggle_trap(self, widget):

    if (self.proxy is None):
        return
    trapactive = widget.get_active()
    self.proxy.set_trap(trapactive)
    status = ('Trap    is    %s' % (('on' if trapactive else 'off'),))
    self.status_bar(status)
    if (not trapactive):
        res = self.reqresp.response.get_object()
        req = self.reqresp.request.get_object()
        if (req and (not res)):
            self._send(None)
