From 2e6cffa44ef5e995139abb9310c9df7fa1795cad Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 7 Aug 2010 17:18:53 +0200 Subject: [PATCH] Aggregate dialog: Initialize HPane widget width on opening. Set the HPane position to 50% of maximum, when the widget is realized. Thanks to Fredrik Clementz for suggesting this. --- src/ui/gui/aggregate-dialog.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ui/gui/aggregate-dialog.c b/src/ui/gui/aggregate-dialog.c index a8d1d20e..e1a688a3 100644 --- a/src/ui/gui/aggregate-dialog.c +++ b/src/ui/gui/aggregate-dialog.c @@ -85,6 +85,8 @@ struct aggregate GtkWidget *sorted_button; GtkWidget *needs_sort_button; + + GtkWidget *pane; }; @@ -445,6 +447,20 @@ on_acr_change (const struct aggregate *agg, GtkTreeView *tv) } +/* Set the pane to 50% of its maximum size */ +static void +set_initial_pos (GtkPaned *pane) +{ + int max_pos; + g_object_get (pane, + "max-position", &max_pos, + NULL); + + gtk_paned_set_position (pane, max_pos / 2); +} + + + /* Pops up the Aggregate dialog box */ void aggregate_dialog (PsppireDataWindow *dw) @@ -467,6 +483,8 @@ aggregate_dialog (PsppireDataWindow *dw) source = get_widget_assert (fd.xml, "dict-view"); break_selector = get_widget_assert (fd.xml, "break-selector"); + fd.pane = get_widget_assert (fd.xml, "hbox1"); + fd.break_variables = get_widget_assert (fd.xml, "psppire-var-view1"); fd.filename_radiobutton = get_widget_assert (fd.xml, "filename-radiobutton"); fd.filename_button = get_widget_assert (fd.xml, "filename-button"); @@ -535,6 +553,10 @@ aggregate_dialog (PsppireDataWindow *dw) g_signal_connect_swapped (fd.summary_arg1_entry, "changed", G_CALLBACK (update_acr), &fd); g_signal_connect_swapped (fd.summary_arg2_entry, "changed", G_CALLBACK (update_acr), &fd); + + g_signal_connect (fd.pane, "realize", G_CALLBACK (set_initial_pos), &fd); + + g_signal_connect_swapped (fd.function_combo, "changed", G_CALLBACK (update_arguments), &fd); -- 2.30.2