[gtk+/gtk-3-22] testframe: Set value before connecting callbacks
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] testframe: Set value before connecting callbacks
- Date: Tue, 7 Mar 2017 01:09:04 +0000 (UTC)
commit 5059348d9f67534fd402aecfb1ef5614aa2ed40c
Author: Daniel Boles <dboles src gnome org>
Date: Mon Mar 6 22:53:15 2017 +0000
testframe: Set value before connecting callbacks
The value comes from the widget, and we were setting this after
connecting the callback, which applies the value to the widget…
tests/testframe.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/tests/testframe.c b/tests/testframe.c
index f16c245..c9a2b95 100644
--- a/tests/testframe.c
+++ b/tests/testframe.c
@@ -166,8 +166,8 @@ int main (int argc, char **argv)
gtk_grid_attach (GTK_GRID (grid), widget, 0, 0, 1, 1);
widget = gtk_spin_button_new_with_range (0, 250, 1);
- g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spin_xthickness_cb), frame);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), pad.left);
+ g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spin_xthickness_cb), frame);
gtk_grid_attach (GTK_GRID (grid), widget, 1, 0, 1, 1);
/* Spin to control ythickness */
@@ -175,8 +175,8 @@ int main (int argc, char **argv)
gtk_grid_attach (GTK_GRID (grid), widget, 0, 1, 1, 1);
widget = gtk_spin_button_new_with_range (0, 250, 1);
- g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spin_ythickness_cb), frame);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), pad.top);
+ g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spin_ythickness_cb), frame);
gtk_grid_attach (GTK_GRID (grid), widget, 1, 1, 1, 1);
gtk_frame_get_label_align (GTK_FRAME (frame), &xalign, &yalign);
@@ -186,8 +186,8 @@ int main (int argc, char **argv)
gtk_grid_attach (GTK_GRID (grid), widget, 0, 2, 1, 1);
widget = gtk_spin_button_new_with_range (0.0, 1.0, 0.1);
- g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spin_xalign_cb), frame);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), xalign);
+ g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spin_xalign_cb), frame);
gtk_grid_attach (GTK_GRID (grid), widget, 1, 2, 1, 1);
/* Spin to control label yalign */
@@ -195,8 +195,8 @@ int main (int argc, char **argv)
gtk_grid_attach (GTK_GRID (grid), widget, 0, 3, 1, 1);
widget = gtk_spin_button_new_with_range (0.0, 1.0, 0.1);
- g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spin_yalign_cb), frame);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), yalign);
+ g_signal_connect (G_OBJECT (widget), "value-changed", G_CALLBACK (spin_yalign_cb), frame);
gtk_grid_attach (GTK_GRID (grid), widget, 1, 3, 1, 1);
gtk_widget_show_all (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]