X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtktestutils.c;h=c41c8920c43c720f2ff736904deea41859d46a15;hb=f076b6bb0284b59de67d5be8d53a14b5bb32e119;hp=aad6a966ea2bc6f1d4724d347e208331fca0c28a;hpb=feece3c0bb2c17599f085263d0f483cc7f172724;p=~andy%2Fgtk diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c index aad6a966e..c41c8920c 100644 --- a/gtk/gtktestutils.c +++ b/gtk/gtktestutils.c @@ -13,9 +13,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ @@ -132,7 +130,7 @@ test_find_widget_input_windows (GtkWidget *widget, * particular because the mouse pointer is warped to the key press * location, see gdk_test_simulate_key() for details. * - * Returns: wether all actions neccessary for the key event simulation were carried out successfully. + * Returns: whether all actions neccessary for the key event simulation were carried out successfully. * * Since: 2.14 **/ @@ -168,7 +166,7 @@ gtk_test_widget_send_key (GtkWidget *widget, * particular because the mouse pointer is warped to the button click * location, see gdk_test_simulate_button() for details. * - * Returns: wether all actions neccessary for the button click simulation were carried out successfully. + * Returns: whether all actions neccessary for the button click simulation were carried out successfully. * * Since: 2.14 **/ @@ -199,7 +197,7 @@ gtk_test_widget_click (GtkWidget *widget, * spin button arrow areas, usually leading to an increase or decrease of * spin button's value. * - * Returns: wether all actions neccessary for the button click simulation were carried out successfully. + * Returns: whether all actions neccessary for the button click simulation were carried out successfully. * * Since: 2.14 **/ @@ -208,18 +206,18 @@ gtk_test_spin_button_click (GtkSpinButton *spinner, guint button, gboolean upwards) { - GdkWindow *panel; + GdkWindow *down_panel = NULL, *up_panel = NULL, *panel; gboolean b1res = FALSE, b2res = FALSE; - panel = _gtk_spin_button_get_panel (spinner); + _gtk_spin_button_get_panels (spinner, &down_panel, &up_panel); + + panel = (upwards) ? up_panel : down_panel; if (panel) { - gint width, pos; - width = gdk_window_get_width (panel); - pos = upwards ? 0 : gdk_window_get_height (panel) - 1; - 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); + gint width = gdk_window_get_width (panel); + b1res = gdk_test_simulate_button (panel, width - 1, 1, button, 0, GDK_BUTTON_PRESS); + b2res = gdk_test_simulate_button (panel, width - 1, 1, button, 0, GDK_BUTTON_RELEASE); } return b1res && b2res; }