'The button action.
Launch the graph window!
:return: None'

def _launch_graph_generator(self, widget):

    selected_function = None
    custom_code = None
    if self._cl_button.get_active():
        selected_function = CONTENT_LENGTH
    elif self._levenshtein_button.get_active():
        selected_function = LEVENSHTEIN
    elif self._http_res_button.get_active():
        selected_function = HTTP_RESPONSE
    elif self._custom_button.get_active():
        selected_function = CUSTOM_FUNCTION
        text_buffer = self._function_tv.get_buffer()
        start_iter = text_buffer.get_start_iter()
        end_iter = text_buffer.get_end_iter()
        custom_code = text_buffer.get_text(start_iter, end_iter, include_hidden_chars=True)
    try:
        window = clusterGraphWidget(self.w3af, self.data, distance_function=selected_function, custom_code=custom_code)
    except BaseFrameworkException as w3:
        msg = str(w3)
        dlg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, msg)
        opt = dlg.run()
        dlg.destroy()
    else:
        self.hide()
        window.connect('destroy', gtk.main_quit)
        gtk.main()
        self.quit(None, None)
