'Process the text.
:param inp: the text input.
:param out: the text output.
:param func: the processing function.'

def _proc(self, inp, out, func, use_repr=False):

    out.set_text(u'')
    busy = gtk.gdk.Window(self.window, gtk.gdk.screen_width(), gtk.gdk.screen_height(), gtk.gdk.WINDOW_CHILD, 0, gtk.gdk.INPUT_ONLY)
    busy.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
    busy.show()
    while gtk.events_pending():
        gtk.main_iteration()
    event = threading.Event()
    txt = inp.get_text()
    proc = ThreadedProc(event, func, txt)
    def proc_done():
        if (not event.isSet()):
            return True
        busy.destroy()
        if proc.ok:
            out.set_text(proc.result, use_repr)
        else:
            msg = _("An    error    was    generated    during    the    execution:\n DCTB  DCTB -    Invalid    input    for    that    operation.\n\nThe    string    that    you    are    trying    to    encode/decode    can't    be    encoded/decoded    using    this    algorithm.    A    detailed    error    follows:\n DCTB  DCTB -    ")
            out.set_text((msg + str(proc.exception)), use_repr=False)
            self.w3af.mainwin.sb(_('Problem    processing    that    string!'))
        return False
    proc.start()
    gobject.timeout_add(200, proc_done)
