Testing

The functions in this section are intended to be used in test programs. They allow to simulate some user input.

Members

Static functions

renderSync
void renderSync(Window window)

Retrieves a pixel from window to force the windowing system to carry out any pending rendering commands. This function is intended to be used to synchronize with rendering pipelines, to benchmark windowing system rendering operations. Since 2.14

simulateButton
int simulateButton(Window window, int x, int y, uint button, GdkModifierType modifiers, GdkEventType buttonPressrelease)

This function is intended to be used in GTK+ test programs. It will warp the mouse pointer to the given (x,y) coordinates 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, gdk_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

simulateKey
int simulateKey(Window window, int x, int y, uint keyval, GdkModifierType modifiers, GdkEventType keyPressrelease)

This function is intended to be used in GTK+ test programs. If (x,y) are > (-1,-1), it will warp the mouse pointer to the given (x,y) coordinates within window and simulate a key press or release event. When the mouse pointer is 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. If (x,y) are passed as (-1,-1), the mouse pointer will not be warped and window origin will be used as mouse pointer location for the event. Also, gdk_test_simulate_key() is a fairly low level function, for most testing purposes, gtk_test_widget_send_key() is the right function to call which will generate a key press event followed by its accompanying key release event. Since 2.14

Meta