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);
act->cutpoint_entry = get_widget_assert (xml, "cutpoint-entry");
act->cutpoint_button = get_widget_assert (xml, "radiobutton4");
- g_object_unref (xml);
-
-
g_signal_connect (act->cutpoint_button, "toggled", G_CALLBACK (set_sensitivity_from_toggle),
act->cutpoint_entry);
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)
{
- GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
- action_class->activate = 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;
}