]> Pileus Git - ~andy/gtk/commitdiff
Add _gtk_spin_button_get_panel private function
authorJavier Jardón <jjardon@gnome.org>
Mon, 12 Jul 2010 22:11:39 +0000 (00:11 +0200)
committerJavier Jardón <jjardon@gnome.org>
Tue, 13 Jul 2010 17:40:50 +0000 (19:40 +0200)
It's needed in gtktestutils.c

gtk/gtkspinbutton.c
gtk/gtkspinbutton.h
gtk/gtktestutils.c

index 6b2eaf04b2f1181a66b37f3f9893a9dd71d0c6d6..727fa5921a9e23c79b2ffd6508ed5f378c2998df 100644 (file)
@@ -2428,3 +2428,9 @@ gtk_spin_button_update (GtkSpinButton *spin_button)
   else
     gtk_spin_button_set_value (spin_button, val);
 }
+
+GdkWindow *
+_gtk_spin_button_get_panel (GtkSpinButton *spin_button)
+{
+  return spin_button->priv->panel;
+}
index 957682ff3f2c6263b8ca1150cf51339bc6105b5f..ba38984f268b2ad24b607386196d90b11360e492 100644 (file)
@@ -169,6 +169,9 @@ void                gtk_spin_button_set_snap_to_ticks  (GtkSpinButton  *spin_button,
 gboolean        gtk_spin_button_get_snap_to_ticks  (GtkSpinButton  *spin_button);
 void            gtk_spin_button_update             (GtkSpinButton  *spin_button);
 
+/* private */
+GdkWindow*      _gtk_spin_button_get_panel         (GtkSpinButton  *spin_button);
+
 G_END_DECLS
 
 #endif /* __GTK_SPIN_BUTTON_H__ */
index e84d487ee0ded8496c7ebce4b110e4fec07001ba..3a76d6bae84736c8ea9681907101689ee064bac6 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include <gtk/gtk.h>
+#include "gtkspinbutton.h"
 
 #include <locale.h>
 #include <string.h>
@@ -189,14 +190,18 @@ gtk_test_spin_button_click (GtkSpinButton  *spinner,
                             guint           button,
                             gboolean        upwards)
 {
+  GdkWindow *panel;
   gboolean b1res = FALSE, b2res = FALSE;
-  if (spinner->panel)
+
+  panel = _gtk_spin_button_get_panel (spinner);
+
+  if (panel)
     {
       gint width, height, pos;
-      gdk_drawable_get_size (spinner->panel, &width, &height);
+      gdk_drawable_get_size (panel, &width, &height);
       pos = upwards ? 0 : height - 1;
-      b1res = gdk_test_simulate_button (spinner->panel, width - 1, pos, button, 0, GDK_BUTTON_PRESS);
-      b2res = gdk_test_simulate_button (spinner->panel, width - 1, pos, button, 0, GDK_BUTTON_RELEASE);
+      b1res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_PRESS);
+      b2res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_RELEASE);
     }
   return b1res && b2res;
 }