on_state_var_changed (GtkAction *a)
{
PsppireDialogActionRoc *act = PSPPIRE_DIALOG_ACTION_ROC (a);
- PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
const gchar *var_name = gtk_entry_get_text (GTK_ENTRY(act->state_variable));
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_pointer (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");
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);
static void
psppire_dialog_action_roc_class_init (PsppireDialogActionRocClass *class)
{
- GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
- action_class->activate = psppire_dialog_action_roc_activate;
+ psppire_dialog_action_set_activation (class, psppire_dialog_action_roc_activate);
PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
}