~ubuntu-branches/ubuntu/raring/gtk+2.0/raring-proposed

« back to all changes in this revision

Viewing changes to docs/reference/gtk/html/gtk2-Testing.html

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2013-01-10 12:53:20 UTC
  • mfrom: (1.14.16)
  • Revision ID: package-import@ubuntu.com-20130110125320-x13bjpwtqq36izs2
Tags: 2.24.14-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
<title>Testing</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 
7
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
 
8
<link rel="up" href="gtkbase.html" title="Part II. GTK+ Core Reference">
 
9
<link rel="prev" href="gtk2-Types.html" title="Types">
 
10
<link rel="next" href="gtk2-Filesystem-utilities.html" title="Filesystem utilities">
 
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
</head>
 
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
16
<tr valign="middle">
 
17
<td><a accesskey="p" href="gtk2-Types.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
18
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 
20
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
 
21
<td><a accesskey="n" href="gtk2-Filesystem-utilities.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
22
</tr>
 
23
<tr><td colspan="5" class="shortcuts">
 
24
<a href="#gtk2-Testing.synopsis" class="shortcut">Top</a>
 
25
                   | 
 
26
                  <a href="#gtk2-Testing.description" class="shortcut">Description</a>
 
27
</td></tr>
 
28
</table>
 
29
<div class="refentry">
 
30
<a name="gtk2-Testing"></a><div class="titlepage"></div>
 
31
<div class="refnamediv"><table width="100%"><tr>
 
32
<td valign="top">
 
33
<h2><span class="refentrytitle"><a name="gtk2-Testing.top_of_page"></a>Testing</span></h2>
 
34
<p>Testing — Utilities for testing GTK+ applications</p>
 
35
</td>
 
36
<td valign="top" align="right"></td>
 
37
</tr></table></div>
 
38
<div class="refsynopsisdiv">
 
39
<a name="gtk2-Testing.synopsis"></a><h2>Synopsis</h2>
 
40
<pre class="synopsis">
 
41
#include &lt;gtk/gtk.h&gt;
 
42
 
 
43
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk2-Testing.html#gtk-test-create-simple-window" title="gtk_test_create_simple_window ()">gtk_test_create_simple_window</a>       (<em class="parameter"><code>const <span class="type">gchar</span> *window_title</code></em>,
 
44
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *dialog_text</code></em>);
 
45
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk2-Testing.html#gtk-test-create-widget" title="gtk_test_create_widget ()">gtk_test_create_widget</a>              (<em class="parameter"><code><span class="type">GType</span> widget_type</code></em>,
 
46
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *first_property_name</code></em>,
 
47
                                                         <em class="parameter"><code>...</code></em>);
 
48
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk2-Testing.html#gtk-test-display-button-window" title="gtk_test_display_button_window ()">gtk_test_display_button_window</a>      (<em class="parameter"><code>const <span class="type">gchar</span> *window_title</code></em>,
 
49
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *dialog_text</code></em>,
 
50
                                                         <em class="parameter"><code>...</code></em>);
 
51
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk2-Testing.html#gtk-test-find-label" title="gtk_test_find_label ()">gtk_test_find_label</a>                 (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
 
52
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *label_pattern</code></em>);
 
53
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk2-Testing.html#gtk-test-find-sibling" title="gtk_test_find_sibling ()">gtk_test_find_sibling</a>               (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *base_widget</code></em>,
 
54
                                                         <em class="parameter"><code><span class="type">GType</span> widget_type</code></em>);
 
55
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk2-Testing.html#gtk-test-find-widget" title="gtk_test_find_widget ()">gtk_test_find_widget</a>                (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
 
56
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *label_pattern</code></em>,
 
57
                                                         <em class="parameter"><code><span class="type">GType</span> widget_type</code></em>);
 
58
<span class="returnvalue">void</span>                <a class="link" href="gtk2-Testing.html#gtk-test-init" title="gtk_test_init ()">gtk_test_init</a>                       (<em class="parameter"><code><span class="type">int</span> *argcp</code></em>,
 
59
                                                         <em class="parameter"><code><span class="type">char</span> ***argvp</code></em>,
 
60
                                                         <em class="parameter"><code>...</code></em>);
 
61
const <span class="returnvalue">GType</span> *       <a class="link" href="gtk2-Testing.html#gtk-test-list-all-types" title="gtk_test_list_all_types ()">gtk_test_list_all_types</a>             (<em class="parameter"><code><span class="type">guint</span> *n_types</code></em>);
 
62
<span class="returnvalue">void</span>                <a class="link" href="gtk2-Testing.html#gtk-test-register-all-types" title="gtk_test_register_all_types ()">gtk_test_register_all_types</a>         (<em class="parameter"><code><span class="type">void</span></code></em>);
 
63
<span class="returnvalue">double</span>              <a class="link" href="gtk2-Testing.html#gtk-test-slider-get-value" title="gtk_test_slider_get_value ()">gtk_test_slider_get_value</a>           (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);
 
64
<span class="returnvalue">void</span>                <a class="link" href="gtk2-Testing.html#gtk-test-slider-set-perc" title="gtk_test_slider_set_perc ()">gtk_test_slider_set_perc</a>            (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
 
65
                                                         <em class="parameter"><code><span class="type">double</span> percentage</code></em>);
 
66
<span class="returnvalue">gboolean</span>            <a class="link" href="gtk2-Testing.html#gtk-test-spin-button-click" title="gtk_test_spin_button_click ()">gtk_test_spin_button_click</a>          (<em class="parameter"><code><a class="link" href="GtkSpinButton.html" title="GtkSpinButton"><span class="type">GtkSpinButton</span></a> *spinner</code></em>,
 
67
                                                         <em class="parameter"><code><span class="type">guint</span> button</code></em>,
 
68
                                                         <em class="parameter"><code><span class="type">gboolean</span> upwards</code></em>);
 
69
<span class="returnvalue">gchar</span> *             <a class="link" href="gtk2-Testing.html#gtk-test-text-get" title="gtk_test_text_get ()">gtk_test_text_get</a>                   (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);
 
70
<span class="returnvalue">void</span>                <a class="link" href="gtk2-Testing.html#gtk-test-text-set" title="gtk_test_text_set ()">gtk_test_text_set</a>                   (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
 
71
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *string</code></em>);
 
72
<span class="returnvalue">gboolean</span>            <a class="link" href="gtk2-Testing.html#gtk-test-widget-click" title="gtk_test_widget_click ()">gtk_test_widget_click</a>               (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
 
73
                                                         <em class="parameter"><code><span class="type">guint</span> button</code></em>,
 
74
                                                         <em class="parameter"><code><a href="../gdk2/gdk2-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>);
 
75
<span class="returnvalue">gboolean</span>            <a class="link" href="gtk2-Testing.html#gtk-test-widget-send-key" title="gtk_test_widget_send_key ()">gtk_test_widget_send_key</a>            (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
 
76
                                                         <em class="parameter"><code><span class="type">guint</span> keyval</code></em>,
 
77
                                                         <em class="parameter"><code><a href="../gdk2/gdk2-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>);
 
78
</pre>
 
79
</div>
 
80
<div class="refsect1">
 
81
<a name="gtk2-Testing.description"></a><h2>Description</h2>
 
82
</div>
 
83
<div class="refsect1">
 
84
<a name="gtk2-Testing.details"></a><h2>Details</h2>
 
85
<div class="refsect2">
 
86
<a name="gtk-test-create-simple-window"></a><h3>gtk_test_create_simple_window ()</h3>
 
87
<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>,
 
88
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *dialog_text</code></em>);</pre>
 
89
<p>
 
90
Create a simple window with window title <em class="parameter"><code>window_title</code></em> and
 
91
text contents <em class="parameter"><code>dialog_text</code></em>.
 
92
The window will quit any running <a class="link" href="gtk2-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>-loop when destroyed, and it
 
93
will automatically be destroyed upon test function teardown.
 
94
</p>
 
95
<div class="variablelist"><table border="0" class="variablelist">
 
96
<colgroup>
 
97
<col align="left" valign="top">
 
98
<col>
 
99
</colgroup>
 
100
<tbody>
 
101
<tr>
 
102
<td><p><span class="term"><em class="parameter"><code>window_title</code></em> :</span></p></td>
 
103
<td>Title of the window to be displayed.</td>
 
104
</tr>
 
105
<tr>
 
106
<td><p><span class="term"><em class="parameter"><code>dialog_text</code></em> :</span></p></td>
 
107
<td>Text inside the window to be displayed.</td>
 
108
</tr>
 
109
<tr>
 
110
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
111
<td>a widget pointer to the newly created GtkWindow. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
112
</td>
 
113
</tr>
 
114
</tbody>
 
115
</table></div>
 
116
<p class="since">Since 2.14</p>
 
117
</div>
 
118
<hr>
 
119
<div class="refsect2">
 
120
<a name="gtk-test-create-widget"></a><h3>gtk_test_create_widget ()</h3>
 
121
<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>,
 
122
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *first_property_name</code></em>,
 
123
                                                         <em class="parameter"><code>...</code></em>);</pre>
 
124
<p>
 
125
This function wraps <code class="function">g_object_new()</code> for widget types.
 
126
It'll automatically show all created non window widgets, also
 
127
<code class="function">g_object_ref_sink()</code> them (to keep them alive across a running test)
 
128
and set them up for destruction during the next test teardown phase.
 
129
</p>
 
130
<div class="variablelist"><table border="0" class="variablelist">
 
131
<colgroup>
 
132
<col align="left" valign="top">
 
133
<col>
 
134
</colgroup>
 
135
<tbody>
 
136
<tr>
 
137
<td><p><span class="term"><em class="parameter"><code>widget_type</code></em> :</span></p></td>
 
138
<td>a valid widget type.</td>
 
139
</tr>
 
140
<tr>
 
141
<td><p><span class="term"><em class="parameter"><code>first_property_name</code></em> :</span></p></td>
 
142
<td>Name of first property to set or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
 
143
</td>
 
144
</tr>
 
145
<tr>
 
146
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
147
<td>a newly created widget.</td>
 
148
</tr>
 
149
</tbody>
 
150
</table></div>
 
151
<p class="since">Since 2.14</p>
 
152
</div>
 
153
<hr>
 
154
<div class="refsect2">
 
155
<a name="gtk-test-display-button-window"></a><h3>gtk_test_display_button_window ()</h3>
 
156
<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>,
 
157
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *dialog_text</code></em>,
 
158
                                                         <em class="parameter"><code>...</code></em>);</pre>
 
159
<p>
 
160
Create a window with window title <em class="parameter"><code>window_title</code></em>, text contents <em class="parameter"><code>dialog_text</code></em>,
 
161
and a number of buttons, according to the paired argument list given
 
162
as @... parameters.
 
163
Each button is created with a <em class="parameter"><code>label</code></em> and a ::clicked signal handler that
 
164
incremrents the integer stored in <em class="parameter"><code>nump</code></em>.
 
165
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
 
166
creation, so when this function returns it has already been mapped,
 
167
resized and positioned on screen.
 
168
The window will quit any running <a class="link" href="gtk2-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>-loop when destroyed, and it
 
169
will automatically be destroyed upon test function teardown.
 
170
</p>
 
171
<div class="variablelist"><table border="0" class="variablelist">
 
172
<colgroup>
 
173
<col align="left" valign="top">
 
174
<col>
 
175
</colgroup>
 
176
<tbody>
 
177
<tr>
 
178
<td><p><span class="term"><em class="parameter"><code>window_title</code></em> :</span></p></td>
 
179
<td>Title of the window to be displayed.</td>
 
180
</tr>
 
181
<tr>
 
182
<td><p><span class="term"><em class="parameter"><code>dialog_text</code></em> :</span></p></td>
 
183
<td>Text inside the window to be displayed.</td>
 
184
</tr>
 
185
<tr>
 
186
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
 
187
<td>
 
188
<a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated list of (const char *label, int *nump) pairs.</td>
 
189
</tr>
 
190
<tr>
 
191
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
192
<td>a widget pointer to the newly created GtkWindow.</td>
 
193
</tr>
 
194
</tbody>
 
195
</table></div>
 
196
<p class="since">Since 2.14</p>
 
197
</div>
 
198
<hr>
 
199
<div class="refsect2">
 
200
<a name="gtk-test-find-label"></a><h3>gtk_test_find_label ()</h3>
 
201
<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>,
 
202
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *label_pattern</code></em>);</pre>
 
203
<p>
 
204
This function will search <em class="parameter"><code>widget</code></em> and all its descendants for a GtkLabel
 
205
widget with a text string matching <em class="parameter"><code>label_pattern</code></em>.
 
206
The <em class="parameter"><code>label_pattern</code></em> may contain asterisks '*' and question marks '?' as
 
207
placeholders, <code class="function">g_pattern_match()</code> is used for the matching.
 
208
Note that locales other than "C" tend to alter (translate" label strings,
 
209
so this function is genrally only useful in test programs with
 
210
predetermined locales, see <a class="link" href="gtk2-Testing.html#gtk-test-init" title="gtk_test_init ()"><code class="function">gtk_test_init()</code></a> for more details.
 
211
</p>
 
212
<div class="variablelist"><table border="0" class="variablelist">
 
213
<colgroup>
 
214
<col align="left" valign="top">
 
215
<col>
 
216
</colgroup>
 
217
<tbody>
 
218
<tr>
 
219
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
 
220
<td>Valid label or container widget.</td>
 
221
</tr>
 
222
<tr>
 
223
<td><p><span class="term"><em class="parameter"><code>label_pattern</code></em> :</span></p></td>
 
224
<td>Shell-glob pattern to match a label string.</td>
 
225
</tr>
 
226
<tr>
 
227
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
228
<td>a GtkLabel widget if any is found. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
229
</td>
 
230
</tr>
 
231
</tbody>
 
232
</table></div>
 
233
<p class="since">Since 2.14</p>
 
234
</div>
 
235
<hr>
 
236
<div class="refsect2">
 
237
<a name="gtk-test-find-sibling"></a><h3>gtk_test_find_sibling ()</h3>
 
238
<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>,
 
239
                                                         <em class="parameter"><code><span class="type">GType</span> widget_type</code></em>);</pre>
 
240
<p>
 
241
This function will search siblings of <em class="parameter"><code>base_widget</code></em> and siblings of its
 
242
ancestors for all widgets matching <em class="parameter"><code>widget_type</code></em>.
 
243
Of the matching widgets, the one that is geometrically closest to
 
244
<em class="parameter"><code>base_widget</code></em> will be returned.
 
245
The general purpose of this function is to find the most likely "action"
 
246
widget, relative to another labeling widget. Such as finding a
 
247
button or text entry widget, given it's corresponding label widget.
 
248
</p>
 
249
<div class="variablelist"><table border="0" class="variablelist">
 
250
<colgroup>
 
251
<col align="left" valign="top">
 
252
<col>
 
253
</colgroup>
 
254
<tbody>
 
255
<tr>
 
256
<td><p><span class="term"><em class="parameter"><code>base_widget</code></em> :</span></p></td>
 
257
<td>Valid widget, part of a widget hierarchy</td>
 
258
</tr>
 
259
<tr>
 
260
<td><p><span class="term"><em class="parameter"><code>widget_type</code></em> :</span></p></td>
 
261
<td>Type of a aearched for sibling widget</td>
 
262
</tr>
 
263
<tr>
 
264
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
265
<td>a widget of type <em class="parameter"><code>widget_type</code></em> if any is found. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
266
</td>
 
267
</tr>
 
268
</tbody>
 
269
</table></div>
 
270
<p class="since">Since 2.14</p>
 
271
</div>
 
272
<hr>
 
273
<div class="refsect2">
 
274
<a name="gtk-test-find-widget"></a><h3>gtk_test_find_widget ()</h3>
 
275
<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>,
 
276
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *label_pattern</code></em>,
 
277
                                                         <em class="parameter"><code><span class="type">GType</span> widget_type</code></em>);</pre>
 
278
<p>
 
279
This function will search the descendants of <em class="parameter"><code>widget</code></em> for a widget
 
280
of type <em class="parameter"><code>widget_type</code></em> that has a label matching <em class="parameter"><code>label_pattern</code></em> next
 
281
to it. This is most useful for automated GUI testing, e.g. to find
 
282
the "OK" button in a dialog and synthesize clicks on it.
 
283
However see <a class="link" href="gtk2-Testing.html#gtk-test-find-label" title="gtk_test_find_label ()"><code class="function">gtk_test_find_label()</code></a>, <a class="link" href="gtk2-Testing.html#gtk-test-find-sibling" title="gtk_test_find_sibling ()"><code class="function">gtk_test_find_sibling()</code></a> and
 
284
<a class="link" href="gtk2-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
 
285
such widgets and synthesizing widget events.
 
286
</p>
 
287
<div class="variablelist"><table border="0" class="variablelist">
 
288
<colgroup>
 
289
<col align="left" valign="top">
 
290
<col>
 
291
</colgroup>
 
292
<tbody>
 
293
<tr>
 
294
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
 
295
<td>Container widget, usually a GtkWindow.</td>
 
296
</tr>
 
297
<tr>
 
298
<td><p><span class="term"><em class="parameter"><code>label_pattern</code></em> :</span></p></td>
 
299
<td>Shell-glob pattern to match a label string.</td>
 
300
</tr>
 
301
<tr>
 
302
<td><p><span class="term"><em class="parameter"><code>widget_type</code></em> :</span></p></td>
 
303
<td>Type of a aearched for label sibling widget.</td>
 
304
</tr>
 
305
<tr>
 
306
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
307
<td>a valid widget if any is found or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
308
</td>
 
309
</tr>
 
310
</tbody>
 
311
</table></div>
 
312
<p class="since">Since 2.14</p>
 
313
</div>
 
314
<hr>
 
315
<div class="refsect2">
 
316
<a name="gtk-test-init"></a><h3>gtk_test_init ()</h3>
 
317
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_test_init                       (<em class="parameter"><code><span class="type">int</span> *argcp</code></em>,
 
318
                                                         <em class="parameter"><code><span class="type">char</span> ***argvp</code></em>,
 
319
                                                         <em class="parameter"><code>...</code></em>);</pre>
 
320
<p>
 
321
This function is used to initialize a GTK+ test program.
 
322
</p>
 
323
<p>
 
324
It will in turn call <code class="function">g_test_init()</code> and <a class="link" href="gtk2-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> to properly
 
325
initialize the testing framework and graphical toolkit. It'll 
 
326
also set the program's locale to "C" and prevent loading of rc 
 
327
files and Gtk+ modules. This is done to make tets program
 
328
environments as deterministic as possible.
 
329
</p>
 
330
<p>
 
331
Like <a class="link" href="gtk2-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
 
332
processed and stripped from <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em>.
 
333
</p>
 
334
<div class="variablelist"><table border="0" class="variablelist">
 
335
<colgroup>
 
336
<col align="left" valign="top">
 
337
<col>
 
338
</colgroup>
 
339
<tbody>
 
340
<tr>
 
341
<td><p><span class="term"><em class="parameter"><code>argcp</code></em> :</span></p></td>
 
342
<td>Address of the <em class="parameter"><code>argc</code></em> parameter of the
 
343
<code class="function">main()</code> function. Changed if any arguments were handled.</td>
 
344
</tr>
 
345
<tr>
 
346
<td><p><span class="term"><em class="parameter"><code>argvp</code></em> :</span></p></td>
 
347
<td>Address of the
 
348
<em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>.
 
349
Any parameters understood by <code class="function">g_test_init()</code> or <a class="link" href="gtk2-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> are
 
350
stripped before return. <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>
 
351
</td>
 
352
</tr>
 
353
</tbody>
 
354
</table></div>
 
355
<p class="since">Since 2.14</p>
 
356
</div>
 
357
<hr>
 
358
<div class="refsect2">
 
359
<a name="gtk-test-list-all-types"></a><h3>gtk_test_list_all_types ()</h3>
 
360
<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>
 
361
<p>
 
362
Return the type ids that have been registered after
 
363
calling <a class="link" href="gtk2-Testing.html#gtk-test-register-all-types" title="gtk_test_register_all_types ()"><code class="function">gtk_test_register_all_types()</code></a>.
 
364
</p>
 
365
<div class="variablelist"><table border="0" class="variablelist">
 
366
<colgroup>
 
367
<col align="left" valign="top">
 
368
<col>
 
369
</colgroup>
 
370
<tbody>
 
371
<tr>
 
372
<td><p><span class="term"><em class="parameter"><code>n_types</code></em> :</span></p></td>
 
373
<td>location to store number of types</td>
 
374
</tr>
 
375
<tr>
 
376
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
377
<td>0-terminated array of type ids. <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="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
378
</td>
 
379
</tr>
 
380
</tbody>
 
381
</table></div>
 
382
<p class="since">Since 2.14</p>
 
383
</div>
 
384
<hr>
 
385
<div class="refsect2">
 
386
<a name="gtk-test-register-all-types"></a><h3>gtk_test_register_all_types ()</h3>
 
387
<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>
 
388
<p>
 
389
Force registration of all core Gtk+ and Gdk object types.
 
390
This allowes to refer to any of those object types via
 
391
<code class="function">g_type_from_name()</code> after calling this function.
 
392
</p>
 
393
<p class="since">Since 2.14</p>
 
394
</div>
 
395
<hr>
 
396
<div class="refsect2">
 
397
<a name="gtk-test-slider-get-value"></a><h3>gtk_test_slider_get_value ()</h3>
 
398
<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>
 
399
<p>
 
400
Retrive the literal adjustment value for GtkRange based
 
401
widgets and spin buttons. Note that the value returned by
 
402
this function is anything between the lower and upper bounds
 
403
of the adjustment belonging to <em class="parameter"><code>widget</code></em>, and is not a percentage
 
404
as passed in to <a class="link" href="gtk2-Testing.html#gtk-test-slider-set-perc" title="gtk_test_slider_set_perc ()"><code class="function">gtk_test_slider_set_perc()</code></a>.
 
405
</p>
 
406
<div class="variablelist"><table border="0" class="variablelist">
 
407
<colgroup>
 
408
<col align="left" valign="top">
 
409
<col>
 
410
</colgroup>
 
411
<tbody>
 
412
<tr>
 
413
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
 
414
<td>valid widget pointer.</td>
 
415
</tr>
 
416
<tr>
 
417
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
418
<td>adjustment-&gt;value for an adjustment belonging to <em class="parameter"><code>widget</code></em>.</td>
 
419
</tr>
 
420
</tbody>
 
421
</table></div>
 
422
<p class="since">Since 2.14</p>
 
423
</div>
 
424
<hr>
 
425
<div class="refsect2">
 
426
<a name="gtk-test-slider-set-perc"></a><h3>gtk_test_slider_set_perc ()</h3>
 
427
<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>,
 
428
                                                         <em class="parameter"><code><span class="type">double</span> percentage</code></em>);</pre>
 
429
<p>
 
430
This function will adjust the slider position of all GtkRange
 
431
based widgets, such as scrollbars or scales, it'll also adjust
 
432
spin buttons. The adjustment value of these widgets is set to
 
433
a value between the lower and upper limits, according to the
 
434
<em class="parameter"><code>percentage</code></em> argument.
 
435
</p>
 
436
<div class="variablelist"><table border="0" class="variablelist">
 
437
<colgroup>
 
438
<col align="left" valign="top">
 
439
<col>
 
440
</colgroup>
 
441
<tbody>
 
442
<tr>
 
443
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
 
444
<td>valid widget pointer.</td>
 
445
</tr>
 
446
<tr>
 
447
<td><p><span class="term"><em class="parameter"><code>percentage</code></em> :</span></p></td>
 
448
<td>value between 0 and 100.</td>
 
449
</tr>
 
450
</tbody>
 
451
</table></div>
 
452
<p class="since">Since 2.14</p>
 
453
</div>
 
454
<hr>
 
455
<div class="refsect2">
 
456
<a name="gtk-test-spin-button-click"></a><h3>gtk_test_spin_button_click ()</h3>
 
457
<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>,
 
458
                                                         <em class="parameter"><code><span class="type">guint</span> button</code></em>,
 
459
                                                         <em class="parameter"><code><span class="type">gboolean</span> upwards</code></em>);</pre>
 
460
<p>
 
461
This function will generate a <em class="parameter"><code>button</code></em> click in the upwards or downwards
 
462
spin button arrow areas, usually leading to an increase or decrease of
 
463
spin button's value.
 
464
</p>
 
465
<div class="variablelist"><table border="0" class="variablelist">
 
466
<colgroup>
 
467
<col align="left" valign="top">
 
468
<col>
 
469
</colgroup>
 
470
<tbody>
 
471
<tr>
 
472
<td><p><span class="term"><em class="parameter"><code>spinner</code></em> :</span></p></td>
 
473
<td>valid GtkSpinButton widget.</td>
 
474
</tr>
 
475
<tr>
 
476
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
 
477
<td>Number of the pointer button for the event, usually 1, 2 or 3.</td>
 
478
</tr>
 
479
<tr>
 
480
<td><p><span class="term"><em class="parameter"><code>upwards</code></em> :</span></p></td>
 
481
<td>
 
482
<code class="literal">TRUE</code> for upwards arrow click, <code class="literal">FALSE</code> for downwards arrow click.</td>
 
483
</tr>
 
484
<tr>
 
485
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
486
<td>wether all actions neccessary for the button click simulation were carried out successfully.</td>
 
487
</tr>
 
488
</tbody>
 
489
</table></div>
 
490
<p class="since">Since 2.14</p>
 
491
</div>
 
492
<hr>
 
493
<div class="refsect2">
 
494
<a name="gtk-test-text-get"></a><h3>gtk_test_text_get ()</h3>
 
495
<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>
 
496
<p>
 
497
Retrive the text string of <em class="parameter"><code>widget</code></em> if it is a GtkLabel,
 
498
GtkEditable (entry and text widgets) or GtkTextView.
 
499
</p>
 
500
<div class="variablelist"><table border="0" class="variablelist">
 
501
<colgroup>
 
502
<col align="left" valign="top">
 
503
<col>
 
504
</colgroup>
 
505
<tbody>
 
506
<tr>
 
507
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
 
508
<td>valid widget pointer.</td>
 
509
</tr>
 
510
<tr>
 
511
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
512
<td>new 0-terminated C string, needs to be released with <code class="function">g_free()</code>.</td>
 
513
</tr>
 
514
</tbody>
 
515
</table></div>
 
516
<p class="since">Since 2.14</p>
 
517
</div>
 
518
<hr>
 
519
<div class="refsect2">
 
520
<a name="gtk-test-text-set"></a><h3>gtk_test_text_set ()</h3>
 
521
<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>,
 
522
                                                         <em class="parameter"><code>const <span class="type">gchar</span> *string</code></em>);</pre>
 
523
<p>
 
524
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,
 
525
GtkEditable (entry and text widgets) or GtkTextView.
 
526
</p>
 
527
<div class="variablelist"><table border="0" class="variablelist">
 
528
<colgroup>
 
529
<col align="left" valign="top">
 
530
<col>
 
531
</colgroup>
 
532
<tbody>
 
533
<tr>
 
534
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
 
535
<td>valid widget pointer.</td>
 
536
</tr>
 
537
<tr>
 
538
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
 
539
<td>a 0-terminated C string</td>
 
540
</tr>
 
541
</tbody>
 
542
</table></div>
 
543
<p class="since">Since 2.14</p>
 
544
</div>
 
545
<hr>
 
546
<div class="refsect2">
 
547
<a name="gtk-test-widget-click"></a><h3>gtk_test_widget_click ()</h3>
 
548
<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>,
 
549
                                                         <em class="parameter"><code><span class="type">guint</span> button</code></em>,
 
550
                                                         <em class="parameter"><code><a href="../gdk2/gdk2-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>);</pre>
 
551
<p>
 
552
This function will generate a <em class="parameter"><code>button</code></em> click (button press and button
 
553
release event) in the middle of the first GdkWindow found that belongs
 
554
to <em class="parameter"><code>widget</code></em>.
 
555
For <a class="link" href="GtkWidget.html#GTK-NO-WINDOW:CAPS"><code class="literal">GTK_NO_WINDOW</code></a> widgets like GtkButton, this will often be an
 
556
input-only event window. For other widgets, this is usually widget-&gt;window.
 
557
Certain caveats should be considered when using this function, in
 
558
particular because the mouse pointer is warped to the button click
 
559
location, see <a href="../gdk2/gdk2-Testing.html#gdk-test-simulate-button"><code class="function">gdk_test_simulate_button()</code></a> for details.
 
560
</p>
 
561
<div class="variablelist"><table border="0" class="variablelist">
 
562
<colgroup>
 
563
<col align="left" valign="top">
 
564
<col>
 
565
</colgroup>
 
566
<tbody>
 
567
<tr>
 
568
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
 
569
<td>Widget to generate a button click on.</td>
 
570
</tr>
 
571
<tr>
 
572
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
 
573
<td>Number of the pointer button for the event, usually 1, 2 or 3.</td>
 
574
</tr>
 
575
<tr>
 
576
<td><p><span class="term"><em class="parameter"><code>modifiers</code></em> :</span></p></td>
 
577
<td>Keyboard modifiers the event is setup with.</td>
 
578
</tr>
 
579
<tr>
 
580
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
581
<td>wether all actions neccessary for the button click simulation were carried out successfully.</td>
 
582
</tr>
 
583
</tbody>
 
584
</table></div>
 
585
<p class="since">Since 2.14</p>
 
586
</div>
 
587
<hr>
 
588
<div class="refsect2">
 
589
<a name="gtk-test-widget-send-key"></a><h3>gtk_test_widget_send_key ()</h3>
 
590
<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>,
 
591
                                                         <em class="parameter"><code><span class="type">guint</span> keyval</code></em>,
 
592
                                                         <em class="parameter"><code><a href="../gdk2/gdk2-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>);</pre>
 
593
<p>
 
594
This function will generate keyboard press and release events in
 
595
the middle of the first GdkWindow found that belongs to <em class="parameter"><code>widget</code></em>.
 
596
For <a class="link" href="GtkWidget.html#GTK-NO-WINDOW:CAPS"><code class="literal">GTK_NO_WINDOW</code></a> widgets like GtkButton, this will often be an
 
597
input-only event window. For other widgets, this is usually widget-&gt;window.
 
598
Certain caveats should be considered when using this function, in
 
599
particular because the mouse pointer is warped to the key press
 
600
location, see <a href="../gdk2/gdk2-Testing.html#gdk-test-simulate-key"><code class="function">gdk_test_simulate_key()</code></a> for details.
 
601
</p>
 
602
<div class="variablelist"><table border="0" class="variablelist">
 
603
<colgroup>
 
604
<col align="left" valign="top">
 
605
<col>
 
606
</colgroup>
 
607
<tbody>
 
608
<tr>
 
609
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
 
610
<td>Widget to generate a key press and release on.</td>
 
611
</tr>
 
612
<tr>
 
613
<td><p><span class="term"><em class="parameter"><code>keyval</code></em> :</span></p></td>
 
614
<td>A Gdk keyboard value.</td>
 
615
</tr>
 
616
<tr>
 
617
<td><p><span class="term"><em class="parameter"><code>modifiers</code></em> :</span></p></td>
 
618
<td>Keyboard modifiers the event is setup with.</td>
 
619
</tr>
 
620
<tr>
 
621
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
622
<td>wether all actions neccessary for the key event simulation were carried out successfully.</td>
 
623
</tr>
 
624
</tbody>
 
625
</table></div>
 
626
<p class="since">Since 2.14</p>
 
627
</div>
 
628
</div>
 
629
</div>
 
630
<div class="footer">
 
631
<hr>
 
632
          Generated by GTK-Doc V1.18</div>
 
633
</body>
 
634
</html>
 
 
b'\\ No newline at end of file'