#include "psppire-dialog.h"
#include "builder-wrapper.h"
-#include "checkbox-treeview.h"
+#include "psppire-checkbox-treeview.h"
#include "psppire-dict.h"
#include "libpspp/str.h"
PsppireDialogActionCrosstabs *act = PSPPIRE_DIALOG_ACTION_CROSSTABS (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("crosstabs.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("crosstabs.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
pda->dialog = get_widget_assert (xml, "crosstabs-dialog");
pda->source = get_widget_assert (xml, "dict-treeview");
act->table_button = get_widget_assert (xml, "print-tables");
act->pivot_button = get_widget_assert (xml, "pivot");
-
- g_object_unref (xml);
-
act->format_options_avalue = TRUE;
act->format_options_table = TRUE;
act->format_options_pivot = TRUE;
- put_checkbox_items_in_treeview (GTK_TREE_VIEW (act->cell_view),
- B_CS_CELL_DEFAULT,
- N_CROSSTABS_CELLS,
- cells
- );
+ psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->cell_view),
+ B_CS_CELL_DEFAULT,
+ N_CROSSTABS_CELLS,
+ cells);
act->cell = gtk_tree_view_get_model (GTK_TREE_VIEW (act->cell_view));
- put_checkbox_items_in_treeview (GTK_TREE_VIEW (act->stat_view),
- B_CS_STATS_DEFAULT,
- N_CROSSTABS_STATS,
- stats
- );
+ psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->stat_view),
+ B_CS_STATS_DEFAULT,
+ N_CROSSTABS_STATS,
+ stats);
act->stat = gtk_tree_view_get_model (GTK_TREE_VIEW (act->stat_view));
static void
psppire_dialog_action_crosstabs_class_init (PsppireDialogActionCrosstabsClass *class)
{
- GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
- action_class->activate = psppire_dialog_action_crosstabs_activate;
-
+ psppire_dialog_action_set_activation (class, psppire_dialog_action_crosstabs_activate);
PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
}