Function

Gtktest_find_widget

since: 2.14

Declaration [src]

GtkWidget*
gtk_test_find_widget (
  GtkWidget* widget,
  const gchar* label_pattern,
  GType widget_type
)

Description [src]

This function will search the descendants of widget for a widget of type widget_type that has a label matching label_pattern next to it. This is most useful for automated GUI testing, e.g. to find the “OK” button in a dialog and synthesize clicks on it. However see gtk_test_find_label(), gtk_test_find_sibling() and gtk_test_widget_click() for possible caveats involving the search of such widgets and synthesizing widget events.

Available since: 2.14

Parameters

widget

Type: GtkWidget

Container widget, usually a GtkWindow.

The data is owned by the caller of the function.
label_pattern

Type: const gchar*

Shell-glob pattern to match a label string.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
widget_type

Type: GType

Type of a aearched for label sibling widget.

Return value

Type: GtkWidget

A valid widget if any is found or NULL.

The data is owned by the called function.
The return value can be NULL.