Testing.simulateButton

This function is intended to be used in Gtk+ test programs. It will warp the mouse pointer to the given (x,y) corrdinates within window and simulate a button press or release event. Because the mouse pointer needs to be warped to the target location, use of this function outside of test programs that run in their own virtual windowing system (e.g. Xvfb) is not recommended. Also, gtk_test_simulate_button() is a fairly low level function, for most testing purposes, gtk_test_widget_click() is the right function to call which will generate a button press event followed by its accompanying button release event. Since 2.14

class Testing
static
int
simulateButton

Parameters

window Window

Gdk window to simulate a button event for.

x int

x coordinate within window for the button event.

y int

y coordinate within window for the button event.

button uint

Number of the pointer button for the event, usually 1, 2 or 3.

modifiers GdkModifierType

Keyboard modifiers the event is setup with.

buttonPressrelease GdkEventType

either GDK_BUTTON_PRESS or GDK_BUTTON_RELEASE

Return Value

Type: int

wether all actions neccessary for a button event simulation were carried out successfully.

Meta