if (endptr == text)
return FALSE;
- return TRUE;
+ return TRUE;
}
static gboolean
GtkTreeIter notused;
- if ( !gtk_tree_model_get_iter_first (vars, ¬used) )
+ if (!gtk_tree_model_get_iter_first (vars, ¬used))
return FALSE;
- if ( ! get_proportion (act, &prop))
+ if (! get_proportion (act, &prop))
return FALSE;
if (prop < 0 || prop > 1.0)
}
-static void
-psppire_dialog_action_binomial_activate (GtkAction *a)
+static GtkBuilder *
+psppire_dialog_action_binomial_activate (PsppireDialogAction *a, GVariant *param)
{
PsppireDialogActionBinomial *act = PSPPIRE_DIALOG_ACTION_BINOMIAL (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
- GtkBuilder *xml = g_hash_table_lookup (thing, a);
- if (!xml)
- {
- xml = builder_new ("binomial.ui");
- g_hash_table_insert (thing, a, xml);
- }
+ GtkBuilder *xml = builder_new ("binomial.ui");
pda->dialog = get_widget_assert (xml, "binomial-dialog");
pda->source = get_widget_assert (xml, "dict-view");
psppire_dialog_action_set_refresh (pda, refresh);
psppire_dialog_action_set_valid_predicate (pda,
- dialog_state_valid);
-
- if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_binomial_parent_class)->activate)
- PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_binomial_parent_class)->activate (pda);
+ dialog_state_valid);
+ return xml;
}
static char *
-generate_syntax (PsppireDialogAction *a)
+generate_syntax (const PsppireDialogAction *a)
{
PsppireDialogActionBinomial *scd = PSPPIRE_DIALOG_ACTION_BINOMIAL (a);
gchar *text = NULL;
ds_init_cstr (&str, "NPAR TEST\n\t/BINOMIAL");
- if ( get_proportion (scd, &prop))
+ if (get_proportion (scd, &prop))
ds_put_c_format (&str, "(%.*g)", DBL_DIG + 1, prop);
ds_put_cstr (&str, " =");
psppire_var_view_append_names_str (PSPPIRE_VAR_VIEW (scd->var_view), 0, &str);
- if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->cutpoint_button)))
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->cutpoint_button)))
{
const gchar *cutpoint = gtk_entry_get_text (GTK_ENTRY (scd->cutpoint_entry));
ds_put_c_format (&str, "(%s)", cutpoint);
static void
psppire_dialog_action_binomial_class_init (PsppireDialogActionBinomialClass *class)
{
- psppire_dialog_action_set_activation (class, psppire_dialog_action_binomial_activate);
+ PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_binomial_activate;
PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
}