X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-roc.c;h=fbf5bfd91ca3fbe634b6cb65cee01d6b16db5951;hb=55268cdabc9575abb4b8f0fd91692e743bf9cc3f;hp=578ef747771b59fb2ee097552ad7c16de7b9936a;hpb=2a71889bf86463fb752bcbab248da47b25b4fd9a;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-roc.c b/src/ui/gui/psppire-dialog-action-roc.c index 578ef74777..fbf5bfd91c 100644 --- a/src/ui/gui/psppire-dialog-action-roc.c +++ b/src/ui/gui/psppire-dialog-action-roc.c @@ -105,7 +105,7 @@ refresh (PsppireDialogAction *rd_) } static void -on_state_var_changed (GtkAction *a) +on_state_var_changed (PsppireDialogAction *a) { PsppireDialogActionRoc *act = PSPPIRE_DIALOG_ACTION_ROC (a); @@ -121,12 +121,20 @@ on_state_var_changed (GtkAction *a) } static void -psppire_dialog_action_roc_activate (GtkAction *a) +psppire_dialog_action_roc_activate (PsppireDialogAction *a) { PsppireDialogActionRoc *act = PSPPIRE_DIALOG_ACTION_ROC (a); PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); - GtkBuilder *xml = builder_new ("roc.ui"); + GHashTable *thing = psppire_dialog_action_get_hash_table (pda); + GtkBuilder *xml = g_hash_table_lookup (thing, a); + if (!xml) + { + xml = builder_new ("roc.ui"); + g_hash_table_insert (thing, a, xml); + } + + pda->dialog = get_widget_assert (xml, "roc-dialog"); pda->source = get_widget_assert (xml, "dict-view"); @@ -142,8 +150,6 @@ psppire_dialog_action_roc_activate (GtkAction *a) g_signal_connect_swapped (act->state_variable, "changed", G_CALLBACK (on_state_var_changed), act); - g_object_unref (xml); - g_signal_connect (act->curve, "toggled", G_CALLBACK (on_curve_button_toggle), act);