910 lines
44 KiB
HTML
910 lines
44 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<title>Testing: GTK+ 3 Reference Manual</title>
|
||
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
|
||
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
|
||
<link rel="up" href="gtkbase.html" title="Part III. GTK+ Core Reference">
|
||
<link rel="prev" href="gtk3-Selections.html" title="Selections">
|
||
<link rel="next" href="gtk3-Filesystem-utilities.html" title="Filesystem utilities">
|
||
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
|
||
<link rel="stylesheet" href="style.css" type="text/css">
|
||
</head>
|
||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
|
||
<td width="100%" align="left" class="shortcuts">
|
||
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
|
||
<a href="#gtk3-Testing.description" class="shortcut">Description</a></span>
|
||
</td>
|
||
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
|
||
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
|
||
<td><a accesskey="p" href="gtk3-Selections.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
|
||
<td><a accesskey="n" href="gtk3-Filesystem-utilities.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
|
||
</tr></table>
|
||
<div class="refentry">
|
||
<a name="gtk3-Testing"></a><div class="titlepage"></div>
|
||
<div class="refnamediv"><table width="100%"><tr>
|
||
<td valign="top">
|
||
<h2><span class="refentrytitle"><a name="gtk3-Testing.top_of_page"></a>Testing</span></h2>
|
||
<p>Testing — Utilities for testing GTK+ applications</p>
|
||
</td>
|
||
<td class="gallery_image" valign="top" align="right"></td>
|
||
</tr></table></div>
|
||
<div class="refsect1">
|
||
<a name="gtk3-Testing.functions"></a><h2>Functions</h2>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="functions_proto_type">
|
||
<col class="functions_proto_name">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-create-simple-window" title="gtk_test_create_simple_window ()">gtk_test_create_simple_window</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-create-widget" title="gtk_test_create_widget ()">gtk_test_create_widget</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-display-button-window" title="gtk_test_display_button_window ()">gtk_test_display_button_window</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-find-label" title="gtk_test_find_label ()">gtk_test_find_label</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-find-sibling" title="gtk_test_find_sibling ()">gtk_test_find_sibling</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-find-widget" title="gtk_test_find_widget ()">gtk_test_find_widget</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-init" title="gtk_test_init ()">gtk_test_init</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">GType</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-list-all-types" title="gtk_test_list_all_types ()">gtk_test_list_all_types</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-register-all-types" title="gtk_test_register_all_types ()">gtk_test_register_all_types</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">double</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-slider-get-value" title="gtk_test_slider_get_value ()">gtk_test_slider_get_value</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-slider-set-perc" title="gtk_test_slider_set_perc ()">gtk_test_slider_set_perc</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">gboolean</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-spin-button-click" title="gtk_test_spin_button_click ()">gtk_test_spin_button_click</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">gchar</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-text-get" title="gtk_test_text_get ()">gtk_test_text_get</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-text-set" title="gtk_test_text_set ()">gtk_test_text_set</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">gboolean</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-widget-click" title="gtk_test_widget_click ()">gtk_test_widget_click</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">gboolean</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-widget-send-key" title="gtk_test_widget_send_key ()">gtk_test_widget_send_key</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-widget-wait-for-draw" title="gtk_test_widget_wait_for_draw ()">gtk_test_widget_wait_for_draw</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="gtk3-Testing.includes"></a><h2>Includes</h2>
|
||
<pre class="synopsis">#include <gtk/gtk.h>
|
||
</pre>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="gtk3-Testing.description"></a><h2>Description</h2>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="gtk3-Testing.functions_details"></a><h2>Functions</h2>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-create-simple-window"></a><h3>gtk_test_create_simple_window ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
gtk_test_create_simple_window (<em class="parameter"><code>const <span class="type">gchar</span> *window_title</code></em>,
|
||
<em class="parameter"><code>const <span class="type">gchar</span> *dialog_text</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_create_simple_window</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>Create a simple window with window title <em class="parameter"><code>window_title</code></em>
|
||
and
|
||
text contents <em class="parameter"><code>dialog_text</code></em>
|
||
.
|
||
The window will quit any running <a class="link" href="gtk3-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>-loop when destroyed, and it
|
||
will automatically be destroyed upon test function teardown.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-create-simple-window.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>window_title</p></td>
|
||
<td class="parameter_description"><p>Title of the window to be displayed.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>dialog_text</p></td>
|
||
<td class="parameter_description"><p>Text inside the window to be displayed.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-create-simple-window.returns"></a><h4>Returns</h4>
|
||
<p>a widget pointer to the newly created GtkWindow. </p>
|
||
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-create-widget"></a><h3>gtk_test_create_widget ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
gtk_test_create_widget (<em class="parameter"><code><span class="type">GType</span> widget_type</code></em>,
|
||
<em class="parameter"><code>const <span class="type">gchar</span> *first_property_name</code></em>,
|
||
<em class="parameter"><code>...</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_create_widget</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>This function wraps <code class="function">g_object_new()</code> for widget types.
|
||
It’ll automatically show all created non window widgets, also
|
||
<code class="function">g_object_ref_sink()</code> them (to keep them alive across a running test)
|
||
and set them up for destruction during the next test teardown phase.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-create-widget.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget_type</p></td>
|
||
<td class="parameter_description"><p>a valid widget type.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>first_property_name</p></td>
|
||
<td class="parameter_description"><p>Name of first property to set or <code class="literal">NULL</code>. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>...</p></td>
|
||
<td class="parameter_description"><p>value to set the first property to, followed by more
|
||
name-value pairs, terminated by <code class="literal">NULL</code></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-create-widget.returns"></a><h4>Returns</h4>
|
||
<p>a newly created widget. </p>
|
||
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-display-button-window"></a><h3>gtk_test_display_button_window ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
gtk_test_display_button_window (<em class="parameter"><code>const <span class="type">gchar</span> *window_title</code></em>,
|
||
<em class="parameter"><code>const <span class="type">gchar</span> *dialog_text</code></em>,
|
||
<em class="parameter"><code>...</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_display_button_window</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>Create a window with window title <em class="parameter"><code>window_title</code></em>
|
||
, text contents <em class="parameter"><code>dialog_text</code></em>
|
||
,
|
||
and a number of buttons, according to the paired argument list given
|
||
as @... parameters.
|
||
Each button is created with a <em class="parameter"><code>label</code></em>
|
||
and a ::clicked signal handler that
|
||
incremrents the integer stored in <em class="parameter"><code>nump</code></em>
|
||
.
|
||
The window will be automatically shown with <a class="link" href="GtkWidget.html#gtk-widget-show-now" title="gtk_widget_show_now ()"><code class="function">gtk_widget_show_now()</code></a> after
|
||
creation, so when this function returns it has already been mapped,
|
||
resized and positioned on screen.
|
||
The window will quit any running <a class="link" href="gtk3-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>-loop when destroyed, and it
|
||
will automatically be destroyed upon test function teardown.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-display-button-window.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>window_title</p></td>
|
||
<td class="parameter_description"><p>Title of the window to be displayed.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>dialog_text</p></td>
|
||
<td class="parameter_description"><p>Text inside the window to be displayed.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>...</p></td>
|
||
<td class="parameter_description"><p><code class="literal">NULL</code> terminated list of (const char *label, int *nump) pairs.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-display-button-window.returns"></a><h4>Returns</h4>
|
||
<p>a widget pointer to the newly created GtkWindow. </p>
|
||
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-find-label"></a><h3>gtk_test_find_label ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
gtk_test_find_label (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
|
||
<em class="parameter"><code>const <span class="type">gchar</span> *label_pattern</code></em>);</pre>
|
||
<p>This function will search <em class="parameter"><code>widget</code></em>
|
||
and all its descendants for a GtkLabel
|
||
widget with a text string matching <em class="parameter"><code>label_pattern</code></em>
|
||
.
|
||
The <em class="parameter"><code>label_pattern</code></em>
|
||
may contain asterisks “*” and question marks “?” as
|
||
placeholders, <code class="function">g_pattern_match()</code> is used for the matching.
|
||
Note that locales other than "C“ tend to alter (translate” label strings,
|
||
so this function is genrally only useful in test programs with
|
||
predetermined locales, see <a class="link" href="gtk3-Testing.html#gtk-test-init" title="gtk_test_init ()"><code class="function">gtk_test_init()</code></a> for more details.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-find-label.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>Valid label or container widget.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>label_pattern</p></td>
|
||
<td class="parameter_description"><p>Shell-glob pattern to match a label string.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-find-label.returns"></a><h4>Returns</h4>
|
||
<p>a GtkLabel widget if any is found. </p>
|
||
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-find-sibling"></a><h3>gtk_test_find_sibling ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
gtk_test_find_sibling (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *base_widget</code></em>,
|
||
<em class="parameter"><code><span class="type">GType</span> widget_type</code></em>);</pre>
|
||
<p>This function will search siblings of <em class="parameter"><code>base_widget</code></em>
|
||
and siblings of its
|
||
ancestors for all widgets matching <em class="parameter"><code>widget_type</code></em>
|
||
.
|
||
Of the matching widgets, the one that is geometrically closest to
|
||
<em class="parameter"><code>base_widget</code></em>
|
||
will be returned.
|
||
The general purpose of this function is to find the most likely “action”
|
||
widget, relative to another labeling widget. Such as finding a
|
||
button or text entry widget, given its corresponding label widget.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-find-sibling.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>base_widget</p></td>
|
||
<td class="parameter_description"><p>Valid widget, part of a widget hierarchy</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget_type</p></td>
|
||
<td class="parameter_description"><p>Type of a aearched for sibling widget</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-find-sibling.returns"></a><h4>Returns</h4>
|
||
<p>a widget of type <em class="parameter"><code>widget_type</code></em>
|
||
if any is found. </p>
|
||
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-find-widget"></a><h3>gtk_test_find_widget ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
|
||
gtk_test_find_widget (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
|
||
<em class="parameter"><code>const <span class="type">gchar</span> *label_pattern</code></em>,
|
||
<em class="parameter"><code><span class="type">GType</span> widget_type</code></em>);</pre>
|
||
<p>This function will search the descendants of <em class="parameter"><code>widget</code></em>
|
||
for a widget
|
||
of type <em class="parameter"><code>widget_type</code></em>
|
||
that has a label matching <em class="parameter"><code>label_pattern</code></em>
|
||
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 <a class="link" href="gtk3-Testing.html#gtk-test-find-label" title="gtk_test_find_label ()"><code class="function">gtk_test_find_label()</code></a>, <a class="link" href="gtk3-Testing.html#gtk-test-find-sibling" title="gtk_test_find_sibling ()"><code class="function">gtk_test_find_sibling()</code></a> and
|
||
<a class="link" href="gtk3-Testing.html#gtk-test-widget-click" title="gtk_test_widget_click ()"><code class="function">gtk_test_widget_click()</code></a> for possible caveats involving the search of
|
||
such widgets and synthesizing widget events.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-find-widget.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>Container widget, usually a GtkWindow.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>label_pattern</p></td>
|
||
<td class="parameter_description"><p>Shell-glob pattern to match a label string.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget_type</p></td>
|
||
<td class="parameter_description"><p>Type of a aearched for label sibling widget.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-find-widget.returns"></a><h4>Returns</h4>
|
||
<p>a valid widget if any is found or <code class="literal">NULL</code>. </p>
|
||
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-init"></a><h3>gtk_test_init ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_test_init (<em class="parameter"><code><span class="type">int</span> *argcp</code></em>,
|
||
<em class="parameter"><code><span class="type">char</span> ***argvp</code></em>,
|
||
<em class="parameter"><code>...</code></em>);</pre>
|
||
<p>This function is used to initialize a GTK+ test program.</p>
|
||
<p>It will in turn call <code class="function">g_test_init()</code> and <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> to properly
|
||
initialize the testing framework and graphical toolkit. It’ll
|
||
also set the program’s locale to “C” and prevent loading of rc
|
||
files and Gtk+ modules. This is done to make tets program
|
||
environments as deterministic as possible.</p>
|
||
<p>Like <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> and <code class="function">g_test_init()</code>, any known arguments will be
|
||
processed and stripped from <em class="parameter"><code>argc</code></em>
|
||
and <em class="parameter"><code>argv</code></em>
|
||
.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-init.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>argcp</p></td>
|
||
<td class="parameter_description"><p>Address of the <code class="literal">argc</code> parameter of the
|
||
<code class="function">main()</code> function. Changed if any arguments were handled.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>argvp</p></td>
|
||
<td class="parameter_description"><p>Address of the
|
||
<code class="literal">argv</code> parameter of <code class="function">main()</code>.
|
||
Any parameters understood by <code class="function">g_test_init()</code> or <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> are
|
||
stripped before return. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argcp]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>...</p></td>
|
||
<td class="parameter_description"><p>currently unused</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-list-all-types"></a><h3>gtk_test_list_all_types ()</h3>
|
||
<pre class="programlisting">const <span class="returnvalue">GType</span> *
|
||
gtk_test_list_all_types (<em class="parameter"><code><span class="type">guint</span> *n_types</code></em>);</pre>
|
||
<p>Return the type ids that have been registered after
|
||
calling <a class="link" href="gtk3-Testing.html#gtk-test-register-all-types" title="gtk_test_register_all_types ()"><code class="function">gtk_test_register_all_types()</code></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-list-all-types.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>n_types</p></td>
|
||
<td class="parameter_description"><p>location to store number of types</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-list-all-types.returns"></a><h4>Returns</h4>
|
||
<p>0-terminated array of type ids. </p>
|
||
<p><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_types zero-terminated=1][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-register-all-types"></a><h3>gtk_test_register_all_types ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_test_register_all_types (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
|
||
<p>Force registration of all core Gtk+ and Gdk object types.
|
||
This allowes to refer to any of those object types via
|
||
<code class="function">g_type_from_name()</code> after calling this function.</p>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-slider-get-value"></a><h3>gtk_test_slider_get_value ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">double</span>
|
||
gtk_test_slider_get_value (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_slider_get_value</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>Retrive the literal adjustment value for GtkRange based
|
||
widgets and spin buttons. Note that the value returned by
|
||
this function is anything between the lower and upper bounds
|
||
of the adjustment belonging to <em class="parameter"><code>widget</code></em>
|
||
, and is not a percentage
|
||
as passed in to <a class="link" href="gtk3-Testing.html#gtk-test-slider-set-perc" title="gtk_test_slider_set_perc ()"><code class="function">gtk_test_slider_set_perc()</code></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-slider-get-value.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>valid widget pointer.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-slider-get-value.returns"></a><h4>Returns</h4>
|
||
<p> gtk_adjustment_get_value (adjustment) for an adjustment belonging to <em class="parameter"><code>widget</code></em>
|
||
.</p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-slider-set-perc"></a><h3>gtk_test_slider_set_perc ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_test_slider_set_perc (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
|
||
<em class="parameter"><code><span class="type">double</span> percentage</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_slider_set_perc</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>This function will adjust the slider position of all GtkRange
|
||
based widgets, such as scrollbars or scales, it’ll also adjust
|
||
spin buttons. The adjustment value of these widgets is set to
|
||
a value between the lower and upper limits, according to the
|
||
<em class="parameter"><code>percentage</code></em>
|
||
argument.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-slider-set-perc.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>valid widget pointer.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>percentage</p></td>
|
||
<td class="parameter_description"><p>value between 0 and 100.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-spin-button-click"></a><h3>gtk_test_spin_button_click ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gboolean</span>
|
||
gtk_test_spin_button_click (<em class="parameter"><code><a class="link" href="GtkSpinButton.html" title="GtkSpinButton"><span class="type">GtkSpinButton</span></a> *spinner</code></em>,
|
||
<em class="parameter"><code><span class="type">guint</span> button</code></em>,
|
||
<em class="parameter"><code><span class="type">gboolean</span> upwards</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_spin_button_click</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>This function will generate a <em class="parameter"><code>button</code></em>
|
||
click in the upwards or downwards
|
||
spin button arrow areas, usually leading to an increase or decrease of
|
||
spin button’s value.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-spin-button-click.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>spinner</p></td>
|
||
<td class="parameter_description"><p>valid GtkSpinButton widget.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>button</p></td>
|
||
<td class="parameter_description"><p>Number of the pointer button for the event, usually 1, 2 or 3.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>upwards</p></td>
|
||
<td class="parameter_description"><p><code class="literal">TRUE</code> for upwards arrow click, <code class="literal">FALSE</code> for downwards arrow click.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-spin-button-click.returns"></a><h4>Returns</h4>
|
||
<p> whether all actions neccessary for the button click simulation were carried out successfully.</p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-text-get"></a><h3>gtk_test_text_get ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gchar</span> *
|
||
gtk_test_text_get (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_text_get</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>Retrive the text string of <em class="parameter"><code>widget</code></em>
|
||
if it is a GtkLabel,
|
||
GtkEditable (entry and text widgets) or GtkTextView.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-text-get.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>valid widget pointer.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-text-get.returns"></a><h4>Returns</h4>
|
||
<p> new 0-terminated C string, needs to be released with <code class="function">g_free()</code>.</p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-text-set"></a><h3>gtk_test_text_set ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_test_text_set (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
|
||
<em class="parameter"><code>const <span class="type">gchar</span> *string</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_text_set</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>Set the text string of <em class="parameter"><code>widget</code></em>
|
||
to <em class="parameter"><code>string</code></em>
|
||
if it is a GtkLabel,
|
||
GtkEditable (entry and text widgets) or GtkTextView.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-text-set.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>valid widget pointer.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>string</p></td>
|
||
<td class="parameter_description"><p>a 0-terminated C string</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-widget-click"></a><h3>gtk_test_widget_click ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gboolean</span>
|
||
gtk_test_widget_click (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
|
||
<em class="parameter"><code><span class="type">guint</span> button</code></em>,
|
||
<em class="parameter"><code><span class="type">GdkModifierType</span> modifiers</code></em>);</pre>
|
||
<div class="warning">
|
||
<p><code class="literal">gtk_test_widget_click</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
|
||
<p>This testing infrastructure is phased out in favor of reftests.</p>
|
||
</div>
|
||
<p>This function will generate a <em class="parameter"><code>button</code></em>
|
||
click (button press and button
|
||
release event) in the middle of the first GdkWindow found that belongs
|
||
to <em class="parameter"><code>widget</code></em>
|
||
.
|
||
For windowless widgets like <a class="link" href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a> (which returns <code class="literal">FALSE</code> from
|
||
<a class="link" href="GtkWidget.html#gtk-widget-get-has-window" title="gtk_widget_get_has_window ()"><code class="function">gtk_widget_get_has_window()</code></a>), this will often be an
|
||
input-only event window. For other widgets, this is usually widget->window.
|
||
Certain caveats should be considered when using this function, in
|
||
particular because the mouse pointer is warped to the button click
|
||
location, see <code class="function">gdk_test_simulate_button()</code> for details.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-widget-click.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>Widget to generate a button click on.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>button</p></td>
|
||
<td class="parameter_description"><p>Number of the pointer button for the event, usually 1, 2 or 3.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>modifiers</p></td>
|
||
<td class="parameter_description"><p>Keyboard modifiers the event is setup with.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-widget-click.returns"></a><h4>Returns</h4>
|
||
<p> whether all actions neccessary for the button click simulation were carried out successfully.</p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-widget-send-key"></a><h3>gtk_test_widget_send_key ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gboolean</span>
|
||
gtk_test_widget_send_key (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
|
||
<em class="parameter"><code><span class="type">guint</span> keyval</code></em>,
|
||
<em class="parameter"><code><span class="type">GdkModifierType</span> modifiers</code></em>);</pre>
|
||
<p>This function will generate keyboard press and release events in
|
||
the middle of the first GdkWindow found that belongs to <em class="parameter"><code>widget</code></em>
|
||
.
|
||
For windowless widgets like <a class="link" href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a> (which returns <code class="literal">FALSE</code> from
|
||
<a class="link" href="GtkWidget.html#gtk-widget-get-has-window" title="gtk_widget_get_has_window ()"><code class="function">gtk_widget_get_has_window()</code></a>), this will often be an
|
||
input-only event window. For other widgets, this is usually widget->window.
|
||
Certain caveats should be considered when using this function, in
|
||
particular because the mouse pointer is warped to the key press
|
||
location, see <code class="function">gdk_test_simulate_key()</code> for details.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-widget-send-key.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>Widget to generate a key press and release on.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>keyval</p></td>
|
||
<td class="parameter_description"><p>A Gdk keyboard value.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>modifiers</p></td>
|
||
<td class="parameter_description"><p>Keyboard modifiers the event is setup with.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-widget-send-key.returns"></a><h4>Returns</h4>
|
||
<p> whether all actions neccessary for the key event simulation were carried out successfully.</p>
|
||
</div>
|
||
<p class="since">Since: 2.14</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-test-widget-wait-for-draw"></a><h3>gtk_test_widget_wait_for_draw ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_test_widget_wait_for_draw (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
|
||
<p>Enters the main loop and waits for <em class="parameter"><code>widget</code></em>
|
||
to be “drawn”. In this
|
||
context that means it waits for the frame clock of <em class="parameter"><code>widget</code></em>
|
||
to have
|
||
run a full styling, layout and drawing cycle.</p>
|
||
<p>This function is intended to be used for syncing with actions that
|
||
depend on <em class="parameter"><code>widget</code></em>
|
||
relayouting or on interaction with the display
|
||
server.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-test-widget-wait-for-draw.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>widget</p></td>
|
||
<td class="parameter_description"><p>the widget to wait for</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="footer">
|
||
<hr>Generated by GTK-Doc V1.33.1</div>
|
||
</body>
|
||
</html> |