/* It updates controls from values of variables, and connects control * signals to callback functions */ void init_diagram (GladeXML *xml) { GtkStyle *style; GtkWidget *canvas; /* Creates trees */ canvas_nodes = g_tree_new_full ( (GCompareDataFunc)canvas_node_compare, NULL, NULL, (GDestroyNotify)canvas_node_delete); canvas_links = g_tree_new_full( (GCompareDataFunc)canvas_link_compare, NULL, NULL, (GDestroyNotify)canvas_link_delete); initialize_pref_controls(); /* Sets canvas background to black */ canvas = glade_xml_get_widget (appdata.xml, "canvas1"); gdk_color_parse ("black", &black_color); gdk_colormap_alloc_color (gdk_colormap_get_system (), &black_color, TRUE, TRUE); style = gtk_style_new (); style->bg[GTK_STATE_NORMAL] = black_color; style->base[GTK_STATE_NORMAL] = black_color; gtk_widget_set_style (canvas, style); gtk_style_set_background (canvas->style, canvas->window, GTK_STATE_NORMAL); /* Initialize the known_protocols table */ delete_gui_protocols (); /* Set the already_updating global flag */ already_updating = FALSE; stop_requested = FALSE; } /* init_diagram */
static void confirm_changes(void) { GtkWidget *widget = NULL; widget = glade_xml_get_widget (appdata.xml, "filter_combo"); on_filter_entry_changed (GTK_COMBO_BOX_ENTRY(widget), NULL); if (colors_changed) { color_list_to_pref (); delete_gui_protocols (); } } /* confirm_changes */
/* reset configuration to saved and close dialog */ void on_cancel_pref_button_clicked (GtkButton * button, gpointer user_data) { /* reset configuration to saved */ copy_config(&pref, tmp_pref); ask_reposition(TRUE); if (colors_changed) { protohash_read_prefvect(pref.colors); delete_gui_protocols (); } hide_pref_dialog(); } /* on_cancel_pref_button_clicked */
static void on_stack_level_changed(GtkComboBox * combo, gpointer data) { pref.stack_level = gtk_combo_box_get_active (combo); delete_gui_protocols(); }