1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835
|
<!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+ 2 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
<link rel="up" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="prev" href="gtk2-Types.html" title="Types">
<link rel="next" href="gtk2-Filesystem-utilities.html" title="Filesystem utilities">
<meta name="generator" content="GTK-Doc V1.33.0 (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="#gtk2-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="gtk2-Types.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gtk2-Filesystem-utilities.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gtk2-Testing"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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="gtk2-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>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk2-Testing.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <gtk/gtkpagesetupunixdialog.h>
</pre>
</div>
<div class="refsect1">
<a name="gtk2-Testing.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="gtk2-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>
<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="gtk2-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="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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>
<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>Varargs</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>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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>
<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="gtk2-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>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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="gtk2-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="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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 it's 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="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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="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
<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
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="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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="gtk2-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="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
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 <em class="parameter"><code>argc</code></em> 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 </p>
<em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>.
<p>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
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>Varargs</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: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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="gtk2-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>
<tr>
<td class="parameter_name"><p>returns</p></td>
<td class="parameter_description"><p>0-terminated array of type ids. </p></td>
<td class="parameter_annotations"><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></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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>
<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="gtk2-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> adjustment->value for an adjustment belonging to <em class="parameter"><code>widget</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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>
<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: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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>
<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> wether all actions neccessary for the button click simulation were carried out successfully.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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>
<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: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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>
<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: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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><a href="../html/gdk2-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>);</pre>
<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 <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
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 <a href="../html/gdk2-Testing.html#gdk-test-simulate-button"><code class="function">gdk_test_simulate_button()</code></a> 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> wether all actions neccessary for the button click simulation were carried out successfully.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></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><a href="../html/gdk2-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> 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 <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
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 <a href="../html/gdk2-Testing.html#gdk-test-simulate-key"><code class="function">gdk_test_simulate_key()</code></a> 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> wether all actions neccessary for the key event simulation were carried out successfully.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-14.html#api-index-2.14">2.14</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.0</div>
</body>
</html>
|