Add _gtk_spin_button_get_panel private function
It's needed in gtktestutils.c
This commit is contained in:
@ -2428,3 +2428,9 @@ gtk_spin_button_update (GtkSpinButton *spin_button)
|
|||||||
else
|
else
|
||||||
gtk_spin_button_set_value (spin_button, val);
|
gtk_spin_button_set_value (spin_button, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GdkWindow *
|
||||||
|
_gtk_spin_button_get_panel (GtkSpinButton *spin_button)
|
||||||
|
{
|
||||||
|
return spin_button->priv->panel;
|
||||||
|
}
|
||||||
|
@ -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);
|
gboolean gtk_spin_button_get_snap_to_ticks (GtkSpinButton *spin_button);
|
||||||
void gtk_spin_button_update (GtkSpinButton *spin_button);
|
void gtk_spin_button_update (GtkSpinButton *spin_button);
|
||||||
|
|
||||||
|
/* private */
|
||||||
|
GdkWindow* _gtk_spin_button_get_panel (GtkSpinButton *spin_button);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GTK_SPIN_BUTTON_H__ */
|
#endif /* __GTK_SPIN_BUTTON_H__ */
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
#include "gtkspinbutton.h"
|
||||||
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -189,14 +190,18 @@ gtk_test_spin_button_click (GtkSpinButton *spinner,
|
|||||||
guint button,
|
guint button,
|
||||||
gboolean upwards)
|
gboolean upwards)
|
||||||
{
|
{
|
||||||
|
GdkWindow *panel;
|
||||||
gboolean b1res = FALSE, b2res = FALSE;
|
gboolean b1res = FALSE, b2res = FALSE;
|
||||||
if (spinner->panel)
|
|
||||||
|
panel = _gtk_spin_button_get_panel (spinner);
|
||||||
|
|
||||||
|
if (panel)
|
||||||
{
|
{
|
||||||
gint width, height, pos;
|
gint width, height, pos;
|
||||||
gdk_drawable_get_size (spinner->panel, &width, &height);
|
gdk_drawable_get_size (panel, &width, &height);
|
||||||
pos = upwards ? 0 : height - 1;
|
pos = upwards ? 0 : height - 1;
|
||||||
b1res = gdk_test_simulate_button (spinner->panel, width - 1, pos, button, 0, GDK_BUTTON_PRESS);
|
b1res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_PRESS);
|
||||||
b2res = gdk_test_simulate_button (spinner->panel, width - 1, pos, button, 0, GDK_BUTTON_RELEASE);
|
b2res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_RELEASE);
|
||||||
}
|
}
|
||||||
return b1res && b2res;
|
return b1res && b2res;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user