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 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkBuilder</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="Builder.html" title="Interface builder">
<link rel="prev" href="gtk-gtkbuildable.html" title="GtkBuildable">
<link rel="next" href="DeprecatedObjects.html" title="Deprecated">
<meta name="generator" content="GTK-Doc V1.14 (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="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk-gtkbuildable.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="Builder.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ Reference Manual</th>
<td><a accesskey="n" href="DeprecatedObjects.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GtkBuilder.synopsis" class="shortcut">Top</a>
|
<a href="#GtkBuilder.description" class="shortcut">Description</a>
|
<a href="#GtkBuilder.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#GtkBuilder.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="GtkBuilder">
<a name="GtkBuilder"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkBuilder.top_of_page"></a>GtkBuilder</span></h2>
<p>GtkBuilder — Build an interface from an XML UI definition</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="GtkBuilder.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <gtk/gtk.h>
<a class="link" href="GtkBuilder.html#GtkBuilder-struct" title="GtkBuilder">GtkBuilder</a>;
<span class="returnvalue">void</span> (<a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()">*GtkBuilderConnectFunc</a>) (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *signal_name</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *handler_name</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *connect_object</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#GConnectFlags"><span class="type">GConnectFlags</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
enum <a class="link" href="GtkBuilder.html#GtkBuilderError" title="enum GtkBuilderError">GtkBuilderError</a>;
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a>* <a class="link" href="GtkBuilder.html#gtk-builder-new" title="gtk_builder_new ()">gtk_builder_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkBuilder.html#gtk-builder-add-from-file" title="gtk_builder_add_from_file ()">gtk_builder_add_from_file</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkBuilder.html#gtk-builder-add-from-string" title="gtk_builder_add_from_string ()">gtk_builder_add_from_string</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkBuilder.html#gtk-builder-add-objects-from-file" title="gtk_builder_add_objects_from_file ()">gtk_builder_add_objects_from_file</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GtkBuilder.html#gtk-builder-add-objects-from-string" title="gtk_builder_add_objects_from_string ()">gtk_builder_add_objects_from_string</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a>* <a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()">gtk_builder_get_object</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a>* <a class="link" href="GtkBuilder.html#gtk-builder-get-objects" title="gtk_builder_get_objects ()">gtk_builder_get_objects</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);
<span class="returnvalue">void</span> <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()">gtk_builder_connect_signals</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span> <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()">gtk_builder_connect_signals_full</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()"><span class="type">GtkBuilderConnectFunc</span></a> func</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span> <a class="link" href="GtkBuilder.html#gtk-builder-set-translation-domain" title="gtk_builder_set_translation_domain ()">gtk_builder_set_translation_domain</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);
const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="GtkBuilder.html#gtk-builder-get-translation-domain" title="gtk_builder_get_translation_domain ()">gtk_builder_get_translation_domain</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);
<a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> <a class="link" href="GtkBuilder.html#gtk-builder-get-type-from-name" title="gtk_builder_get_type_from_name ()">gtk_builder_get_type_from_name</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *type_name</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string" title="gtk_builder_value_from_string ()">gtk_builder_value_from_string</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string-type" title="gtk_builder_value_from_string_type ()">gtk_builder_value_from_string_type</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
#define <a class="link" href="GtkBuilder.html#GTK-BUILDER-WARN-INVALID-CHILD-TYPE:CAPS" title="GTK_BUILDER_WARN_INVALID_CHILD_TYPE()">GTK_BUILDER_WARN_INVALID_CHILD_TYPE</a> (object,
type)
#define <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR">GTK_BUILDER_ERROR</a>
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="GtkBuilder.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----GtkBuilder
</pre>
</div>
<div class="refsect1" title="Properties">
<a name="GtkBuilder.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GtkBuilder.html#GtkBuilder--translation-domain" title='The "translation-domain" property'>translation-domain</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write
</pre>
</div>
<div class="refsect1" title="Description">
<a name="GtkBuilder.description"></a><h2>Description</h2>
<p>
A GtkBuilder is an auxiliary object that reads textual descriptions
of a user interface and instantiates the described objects. To pass a
description to a GtkBuilder, call <a class="link" href="GtkBuilder.html#gtk-builder-add-from-file" title="gtk_builder_add_from_file ()"><code class="function">gtk_builder_add_from_file()</code></a> or
<a class="link" href="GtkBuilder.html#gtk-builder-add-from-string" title="gtk_builder_add_from_string ()"><code class="function">gtk_builder_add_from_string()</code></a>. These functions can be called multiple
times; the builder merges the content of all descriptions.
</p>
<p>
A GtkBuilder holds a reference to all objects that it has constructed
and drops these references when it is finalized. This finalization can
cause the destruction of non-widget objects or widgets which are not
contained in a toplevel window. For toplevel windows constructed by a
builder, it is the responsibility of the user to call <a class="link" href="GtkWidget.html#gtk-widget-destroy" title="gtk_widget_destroy ()"><code class="function">gtk_widget_destroy()</code></a>
to get rid of them and all the widgets they contain.
</p>
<p>
The functions <a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()"><code class="function">gtk_builder_get_object()</code></a> and <a class="link" href="GtkBuilder.html#gtk-builder-get-objects" title="gtk_builder_get_objects ()"><code class="function">gtk_builder_get_objects()</code></a>
can be used to access the widgets in the interface by the names assigned
to them inside the UI description. Toplevel windows returned by these
functions will stay around until the user explicitly destroys them
with <a class="link" href="GtkWidget.html#gtk-widget-destroy" title="gtk_widget_destroy ()"><code class="function">gtk_widget_destroy()</code></a>. Other widgets will either be part of a
larger hierarchy constructed by the builder (in which case you should
not have to worry about their lifecycle), or without a parent, in which
case they have to be added to some container to make use of them.
Non-widget objects need to be reffed with <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> to keep them
beyond the lifespan of the builder.
</p>
<p>
The function <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a> and variants thereof can be
used to connect handlers to the named signals in the description.
</p>
<div class="refsect2" title="GtkBuilder UI Definitions">
<a name="BUILDER-UI"></a><h3>GtkBuilder UI Definitions</h3>
<p>
GtkBuilder parses textual descriptions of user interfaces which
are specified in an XML format which can be roughly described
by the DTD below. We refer to these descriptions as
<em class="firstterm">GtkBuilder UI definitions</em> or just
<em class="firstterm">UI definitions</em> if the context is clear.
Do not confuse GtkBuilder UI Definitions with
<a class="link" href="GtkUIManager.html#XML-UI" title="UI Definitions">GtkUIManager UI Definitions</a>,
which are more limited in scope.
</p>
<p>
</p>
<pre class="programlisting">
<!ELEMENT interface (requires|object)* >
<!ELEMENT object (property|signal|child|ANY)* >
<!ELEMENT property PCDATA >
<!ELEMENT signal EMPTY >
<!ELEMENT requires EMPTY >
<!ELEMENT child (object|ANY*) >
<!ATTLIST interface domain #IMPLIED >
<!ATTLIST object id #REQUIRED
class #REQUIRED
type-func #IMPLIED
constructor #IMPLIED >
<!ATTLIST requires lib #REQUIRED
version #REQUIRED >
<!ATTLIST property name #REQUIRED
translatable #IMPLIED
comments #IMPLIED
context #IMPLIED >
<!ATTLIST signal name #REQUIRED
handler #REQUIRED
after #IMPLIED
swapped #IMPLIED
object #IMPLIED
last_modification_time #IMPLIED >
<!ATTLIST child type #IMPLIED
internal-child #IMPLIED >
</pre>
<p>
</p>
<p>
The toplevel element is <interface>.
It optionally takes a "domain" attribute, which will make
the builder look for translated strings using <code class="function">dgettext()</code> in the
domain specified. This can also be done by calling
<a class="link" href="GtkBuilder.html#gtk-builder-set-translation-domain" title="gtk_builder_set_translation_domain ()"><code class="function">gtk_builder_set_translation_domain()</code></a> on the builder.
Objects are described by <object> elements, which can
contain <property> elements to set properties, <signal>
elements which connect signals to handlers, and <child>
elements, which describe child objects (most often widgets
inside a container, but also e.g. actions in an action group,
or columns in a tree model). A <child> element contains
an <object> element which describes the child object.
The target toolkit version(s) are described by <requires>
elements, the "lib" attribute specifies the widget library in
question (currently the only supported value is "gtk+") and the "version"
attribute specifies the target version in the form "<major>.<minor>".
The builder will error out if the version requirements are not met.
</p>
<p>
Typically, the specific kind of object represented by an
<object> element is specified by the "class" attribute.
If the type has not been loaded yet, GTK+ tries to find the
<code class="function"><code class="function">_get_type()</code></code> from the class name by applying
heuristics. This works in most cases, but if necessary, it is
possible to specify the name of the <code class="function"><code class="function">_get_type()</code></code>
explictly with the "type-func" attribute. As a special case,
GtkBuilder allows to use an object that has been constructed
by a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> in another part of the UI definition by
specifying the id of the <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> in the "constructor"
attribute and the name of the object in the "id" attribute.
</p>
<p>
Objects must be given a name with the "id" attribute, which
allows the application to retrieve them from the builder with
<a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()"><code class="function">gtk_builder_get_object()</code></a>. An id is also necessary to use the
object as property value in other parts of the UI definition.
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>Prior to 2.20, GtkBuilder was setting the "name"
property of constructed widgets to the "id" attribute. In GTK+
2.20 or newer, you have to use <a class="link" href="gtk-gtkbuildable.html#gtk-buildable-get-name" title="gtk_buildable_get_name ()"><code class="function">gtk_buildable_get_name()</code></a> instead
of <a class="link" href="GtkWidget.html#gtk-widget-get-name" title="gtk_widget_get_name ()"><code class="function">gtk_widget_get_name()</code></a> to obtain the "id", or set the "name"
property in your UI definition.
</p>
</div>
<p>
Setting properties of objects is pretty straightforward with
the <property> element: the "name" attribute specifies
the name of the property, and the content of the element
specifies the value. If the "translatable" attribute is
set to a true value, GTK+ uses <code class="function">gettext()</code> (or <code class="function">dgettext()</code> if
the builder has a translation domain set) to find a translation
for the value. This happens before the value is parsed, so
it can be used for properties of any type, but it is probably
most useful for string properties. It is also possible to
specify a context to disambiguate short strings, and comments
which may help the translators.
</p>
<p>
GtkBuilder can parse textual representations for the most
common property types: characters, strings, integers, floating-point
numbers, booleans (strings like "TRUE", "t", "yes", "y", "1" are
interpreted as <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, strings like "FALSE, "f", "no", "n", "0" are
interpreted as <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>), enumerations (can be specified by their
name, nick or integer value), flags (can be specified by their name,
nick, integer value, optionally combined with "|", e.g.
"GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by
<a href="http://library.gnome.org/devel/gdk/unstable/gdk-Colormaps-and-Colors.html#gdk-color-parse"><code class="function">gdk_color_parse()</code></a>). Objects can be referred to by their name.
Pixbufs can be specified as a filename of an image file to load.
In general, GtkBuilder allows forward references to objects —
an object doesn't have to constructed before it can be referred to.
The exception to this rule is that an object has to be constructed
before it can be used as the value of a construct-only property.
</p>
<p>
Signal handlers are set up with the <signal> element.
The "name" attribute specifies the name of the signal, and the
"handler" attribute specifies the function to connect to the signal.
By default, GTK+ tries to find the handler using <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#g-module-symbol"><code class="function">g_module_symbol()</code></a>,
but this can be changed by passing a custom <a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()"><span class="type">GtkBuilderConnectFunc</span></a>
to <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a>. The remaining attributes,
"after", "swapped" and "object", have the same meaning as the
corresponding parameters of the <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-object"><code class="function">g_signal_connect_object()</code></a> or
<a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-data"><code class="function">g_signal_connect_data()</code></a> functions. A "last_modification_time" attribute
is also allowed, but it does not have a meaning to the builder.
</p>
<p>
Sometimes it is necessary to refer to widgets which have implicitly
been constructed by GTK+ as part of a composite widget, to set
properties on them or to add further children (e.g. the <em class="parameter"><code>vbox</code></em>
of a <a class="link" href="GtkDialog.html" title="GtkDialog"><span class="type">GtkDialog</span></a>). This can be achieved by setting the "internal-child"
propery of the <child> element to a true value. Note that
GtkBuilder still requires an <object> element for the internal
child, even if it has already been constructed.
</p>
<p>
A number of widgets have different places where a child can be
added (e.g. tabs vs. page content in notebooks). This can be reflected
in a UI definition by specifying the "type" attribute on a <child>
The possible values for the "type" attribute are described in
the sections describing the widget-specific portions of UI definitions.
</p>
<div class="example">
<a name="id1211166"></a><p class="title"><b>Example 58. A GtkBuilder UI Definition</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="symbol"><</span><span class="normal">interface</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">object class</span><span class="symbol">=</span><span class="string">"GtkDialog"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"dialog1"</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">child internal</span><span class="symbol">-</span><span class="normal">child</span><span class="symbol">=</span><span class="string">"vbox"</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">object class</span><span class="symbol">=</span><span class="string">"GtkVBox"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"vbox1"</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">property name</span><span class="symbol">=</span><span class="string">"border-width"</span><span class="symbol">></span><span class="number">10</span><span class="symbol"></</span><span class="normal">property</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">child internal</span><span class="symbol">-</span><span class="normal">child</span><span class="symbol">=</span><span class="string">"action_area"</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">object class</span><span class="symbol">=</span><span class="string">"GtkHButtonBox"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"hbuttonbox1"</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">property name</span><span class="symbol">=</span><span class="string">"border-width"</span><span class="symbol">></span><span class="number">20</span><span class="symbol"></</span><span class="normal">property</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">child</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">object class</span><span class="symbol">=</span><span class="string">"GtkButton"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"ok_button"</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">property name</span><span class="symbol">=</span><span class="string">"label"</span><span class="symbol">></span><span class="normal">gtk</span><span class="symbol">-</span><span class="normal">ok</span><span class="symbol"></</span><span class="normal">property</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">property name</span><span class="symbol">=</span><span class="string">"use-stock"</span><span class="symbol">></span><span class="normal"><a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol"></</span><span class="normal">property</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"><</span><span class="normal">signal name</span><span class="symbol">=</span><span class="string">"clicked"</span><span class="normal"> handler</span><span class="symbol">=</span><span class="string">"ok_button_clicked"</span><span class="symbol">/></span>
<span class="normal"> </span><span class="symbol"></</span><span class="normal">object</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"></</span><span class="normal">child</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"></</span><span class="normal">object</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"></</span><span class="normal">child</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"></</span><span class="normal">object</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"></</span><span class="normal">child</span><span class="symbol">></span>
<span class="normal"> </span><span class="symbol"></</span><span class="normal">object</span><span class="symbol">></span>
<span class="symbol"></</span><span class="normal">interface</span><span class="symbol">></span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<br class="example-break"><p>
Beyond this general structure, several object classes define
their own XML DTD fragments for filling in the ANY placeholders
in the DTD above. Note that a custom element in a <child>
element gets parsed by the custom tag handler of the parent
object, while a custom element in an <object> element
gets parsed by the custom tag handler of the object.
</p>
<p>
These XML fragments are explained in the documentation of the
respective objects, see
<a class="link" href="GtkWidget.html#GtkWidget-BUILDER-UI" title="GtkWidget as GtkBuildable">GtkWidget</a>,
<a class="link" href="GtkLabel.html#GtkLabel-BUILDER-UI" title="GtkLabel as GtkBuildable">GtkLabel</a>,
<a class="link" href="GtkWindow.html#GtkWindow-BUILDER-UI" title="GtkWindow as GtkBuildable">GtkWindow</a>,
<a class="link" href="GtkContainer.html#GtkContainer-BUILDER-UI" title="GtkContainer as GtkBuildable">GtkContainer</a>,
<a class="link" href="GtkDialog.html#GtkDialog-BUILDER-UI" title="GtkDialog as GtkBuildable">GtkDialog</a>,
<a class="link" href="GtkCellLayout.html#GtkCellLayout-BUILDER-UI" title="GtkCellLayouts as GtkBuildable">GtkCellLayout</a>,
<a class="link" href="GtkColorSelectionDialog.html#GtkColorSelectionDialog-BUILDER-UI" title="GtkColorSelectionDialog as GtkBuildable">GtkColorSelectionDialog</a>,
<a class="link" href="GtkFontSelectionDialog.html#GtkFontSelectionDialog-BUILDER-UI" title="GtkFontSelectionDialog as GtkBuildable">GtkFontSelectionDialog</a>,
<a class="link" href="GtkComboBoxEntry.html#GtkComboBoxEntry-BUILDER-UI" title="GtkComboBoxEntry as GtkBuildable">GtkComboBoxEntry</a>,
<a class="link" href="GtkExpander.html#GtkExpander-BUILDER-UI" title="GtkExpander as GtkBuildable">GtkExpander</a>,
<a class="link" href="GtkFrame.html#GtkFrame-BUILDER-UI" title="GtkFrame as GtkBuildable">GtkFrame</a>,
<a class="link" href="GtkListStore.html#GtkListStore-BUILDER-UI" title="GtkListStore as GtkBuildable">GtkListStore</a>,
<a class="link" href="GtkTreeStore.html#GtkTreeStore-BUILDER-UI" title="GtkTreeStore as GtkBuildable">GtkTreeStore</a>,
<a class="link" href="GtkNotebook.html#GtkNotebook-BUILDER-UI" title="GtkNotebook as GtkBuildable">GtkNotebook</a>,
<a class="link" href="GtkSizeGroup.html#GtkSizeGroup-BUILDER-UI" title="GtkSizeGroup as GtkBuildable">GtkSizeGroup</a>,
<a class="link" href="GtkTreeView.html#GtkTreeView-BUILDER-UI" title="GtkTreeView as GtkBuildable">GtkTreeView</a>,
<a class="link" href="GtkUIManager.html#GtkUIManager-BUILDER-UI" title="GtkUIManager as GtkBuildable">GtkUIManager</a>,
<a class="link" href="GtkActionGroup.html#GtkActionGroup-BUILDER-UI" title="GtkActionGroup as GtkBuildable">GtkActionGroup</a>.
<a class="link" href="GtkMenuItem.html#GtkMenuItem-BUILDER-UI" title="GtkMenuItem as GtkBuildable">GtkMenuItem</a>,
<a class="link" href="GtkAssistant.html#GtkAssistant-BUILDER-UI" title="GtkAssistant as GtkBuildable">GtkAssistant</a>,
<a class="link" href="GtkScale.html#GtkScale-BUILDER-UI" title="GtkScale as GtkBuildable">GtkScale</a>.
</p>
</div>
</div>
<div class="refsect1" title="Details">
<a name="GtkBuilder.details"></a><h2>Details</h2>
<div class="refsect2" title="GtkBuilder">
<a name="GtkBuilder-struct"></a><h3>GtkBuilder</h3>
<pre class="programlisting">typedef struct _GtkBuilder GtkBuilder;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="GtkBuilderConnectFunc ()">
<a name="GtkBuilderConnectFunc"></a><h3>GtkBuilderConnectFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*GtkBuilderConnectFunc) (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *signal_name</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *handler_name</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *connect_object</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#GConnectFlags"><span class="type">GConnectFlags</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This is the signature of a function used to connect signals. It is used
by the <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a> and <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a>
methods. It is mainly intended for interpreted language bindings, but
could be useful where the programmer wants more control over the signal
connection process.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>object to connect a signal to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>signal_name</code></em> :</span></p></td>
<td>name of the signal
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler_name</code></em> :</span></p></td>
<td>name of the handler
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>connect_object</code></em> :</span></p></td>
<td>a <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, if non-<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, use <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-object"><code class="function">g_signal_connect_object()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#GConnectFlags"><span class="type">GConnectFlags</span></a> to use
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="enum GtkBuilderError">
<a name="GtkBuilderError"></a><h3>enum GtkBuilderError</h3>
<pre class="programlisting">typedef enum
{
GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
GTK_BUILDER_ERROR_UNHANDLED_TAG,
GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
GTK_BUILDER_ERROR_INVALID_TAG,
GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
GTK_BUILDER_ERROR_INVALID_VALUE,
GTK_BUILDER_ERROR_VERSION_MISMATCH,
GTK_BUILDER_ERROR_DUPLICATE_ID
} GtkBuilderError;
</pre>
<p>
Error codes that identify various errors that can occur while
using <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-INVALID-TYPE-FUNCTION:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION</code></span></p></td>
<td>A type-func attribute didn't name
a function that returns a <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a>.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-UNHANDLED-TAG:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_UNHANDLED_TAG</code></span></p></td>
<td>The input contained a tag that <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
can't handle.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-MISSING-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_MISSING_ATTRIBUTE</code></span></p></td>
<td>An attribute that is required by
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> was missing.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-INVALID-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_INVALID_ATTRIBUTE</code></span></p></td>
<td>
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> found an attribute that
it doesn't understand.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-INVALID-TAG:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_INVALID_TAG</code></span></p></td>
<td>
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> found a tag that
it doesn't understand.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-MISSING-PROPERTY-VALUE:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE</code></span></p></td>
<td>A required property value was
missing.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-INVALID-VALUE:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_INVALID_VALUE</code></span></p></td>
<td>
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> couldn't parse
some attribute value.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-VERSION-MISMATCH:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_VERSION_MISMATCH</code></span></p></td>
<td>The input file requires a newer version
of GTK+.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-DUPLICATE-ID:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_DUPLICATE_ID</code></span></p></td>
<td>An object id occurred twice.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_builder_new ()">
<a name="gtk-builder-new"></a><h3>gtk_builder_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a>* gtk_builder_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new builder object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> object
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_add_from_file ()">
<a name="gtk-builder-add-from-file"></a><h3>gtk_builder_add_from_file ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_from_file (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a file containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder
UI definition</a> and merges it with the current contents of <em class="parameter"><code>builder</code></em>.
</p>
<p>
Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a>
domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>the name of the file to parse
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>. </td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A positive value on success, 0 if an error occurred
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_add_from_string ()">
<a name="gtk-builder-add-from-string"></a><h3>gtk_builder_add_from_string ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_from_string (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a string containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder
UI definition</a> and merges it with the current contents of <em class="parameter"><code>builder</code></em>.
</p>
<p>
Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>the string to parse
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>. </td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A positive value on success, 0 if an error occurred
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_add_objects_from_file ()">
<a name="gtk-builder-add-objects-from-file"></a><h3>gtk_builder_add_objects_from_file ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_objects_from_file (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a file containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder
UI definition</a> building only the requested objects and merges
them with the current contents of <em class="parameter"><code>builder</code></em>.
</p>
<p>
Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a>
domain.
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
If you are adding an object that depends on an object that is not
its child (for instance a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> that depends on its
<a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>), you have to explicitely list all of them in <em class="parameter"><code>object_ids</code></em>.
</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>the name of the file to parse
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object_ids</code></em> :</span></p></td>
<td>nul-terminated array of objects to build
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>. </td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A positive value on success, 0 if an error occurred
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_add_objects_from_string ()">
<a name="gtk-builder-add-objects-from-string"></a><h3>gtk_builder_add_objects_from_string ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_builder_add_objects_from_string (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a string containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder
UI definition</a> building only the requested objects and merges
them with the current contents of <em class="parameter"><code>builder</code></em>.
</p>
<p>
Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> domain.
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
If you are adding an object that depends on an object that is not
its child (for instance a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> that depends on its
<a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>), you have to explicitely list all of them in <em class="parameter"><code>object_ids</code></em>.
</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>the string to parse
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object_ids</code></em> :</span></p></td>
<td>nul-terminated array of objects to build
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>. </td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A positive value on success, 0 if an error occurred
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_get_object ()">
<a name="gtk-builder-get-object"></a><h3>gtk_builder_get_object ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a>* gtk_builder_get_object (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<p>
Gets the object named <em class="parameter"><code>name</code></em>. Note that this function does not
increment the reference count of the returned object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>name of object to get
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the object named <em class="parameter"><code>name</code></em> or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if
it could not be found in the object tree.
. <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>. </td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_get_objects ()">
<a name="gtk-builder-get-objects"></a><h3>gtk_builder_get_objects ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a>* gtk_builder_get_objects (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);</pre>
<p>
Gets all objects that have been constructed by <em class="parameter"><code>builder</code></em>. Note that
this function does not increment the reference counts of the returned
objects.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly-allocated <a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> containing all the objects
constructed by the <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> instance. It should be freed by
<a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#g-slist-free"><code class="function">g_slist_free()</code></a>
. <acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GObject. <acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym> GObject. </td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_connect_signals ()">
<a name="gtk-builder-connect-signals"></a><h3>gtk_builder_connect_signals ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_connect_signals (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This method is a simpler variation of <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a>.
It uses <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#GModule"><span class="type">GModule</span></a>'s introspective features (by opening the module <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>)
to look at the application's symbol table. From here it tries to match
the signal handler names given in the interface description with
symbols in the application and connects the signals.
</p>
<p>
Note that this function will not work correctly if <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#GModule"><span class="type">GModule</span></a> is not
supported on the platform.
</p>
<p>
When compiling applications for Windows, you must declare signal callbacks
with <a href="/usr/share/gtk-doc/html/glib/glib-Dynamic-Loading-of-Modules.html#G-MODULE-EXPORT:CAPS"><span class="type">G_MODULE_EXPORT</span></a>, or they will not be put in the symbol table.
On Linux and Unices, this is not necessary; applications should instead
be compiled with the -Wl,--export-dynamic CFLAGS, and linked against
gmodule-export-2.0.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>a pointer to a structure sent in as user data to all signals
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_connect_signals_full ()">
<a name="gtk-builder-connect-signals-full"></a><h3>gtk_builder_connect_signals_full ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_connect_signals_full (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()"><span class="type">GtkBuilderConnectFunc</span></a> func</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This function can be thought of the interpreted language binding
version of <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a>, except that it does not
require GModule to function correctly.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the function used to connect the signals
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>arbitrary data that will be passed to the connection function
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_set_translation_domain ()">
<a name="gtk-builder-set-translation-domain"></a><h3>gtk_builder_set_translation_domain ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gtk_builder_set_translation_domain (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);</pre>
<p>
Sets the translation domain of <em class="parameter"><code>builder</code></em>.
See <a class="link" href="GtkBuilder.html#GtkBuilder--translation-domain" title='The "translation-domain" property'><span class="type">"translation-domain"</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td> the translation domain or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>. </td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_get_translation_domain ()">
<a name="gtk-builder-get-translation-domain"></a><h3>gtk_builder_get_translation_domain ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* gtk_builder_get_translation_domain (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);</pre>
<p>
Gets the translation domain of <em class="parameter"><code>builder</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the translation domain. This string is owned
by the builder object and must not be modified or freed.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_get_type_from_name ()">
<a name="gtk-builder-get-type-from-name"></a><h3>gtk_builder_get_type_from_name ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> gtk_builder_get_type_from_name (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *type_name</code></em>);</pre>
<p>
Looks up a type by name, using the virtual function that
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> has for that purpose. This is mainly used when
implementing the <a class="link" href="gtk-gtkbuildable.html#GtkBuildable"><span class="type">GtkBuildable</span></a> interface on a type.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
<td>type name to lookup
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> found for <em class="parameter"><code>type_name</code></em> or <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-INVALID:CAPS"><span class="type">G_TYPE_INVALID</span></a>
if no type was found
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_value_from_string ()">
<a name="gtk-builder-value-from-string"></a><h3>gtk_builder_value_from_string ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_builder_value_from_string (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
This function demarshals a value from a string. This function
calls <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a> on the <em class="parameter"><code>value</code></em> argument, so it need not be
initialised beforehand.
</p>
<p>
This function can handle char, uchar, boolean, int, uint, long,
ulong, enum, flags, float, double, string, <a href="http://library.gnome.org/devel/gdk/unstable/gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a> and
<a class="link" href="GtkAdjustment.html" title="GtkAdjustment"><span class="type">GtkAdjustment</span></a> type values. Support for <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> type values is
still to come.
</p>
<p>
Upon errors <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pspec</code></em> :</span></p></td>
<td>the <a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> for the property
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>the string representation of the value
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>the <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> to store the result in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>. </td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="gtk_builder_value_from_string_type ()">
<a name="gtk-builder-value-from-string-type"></a><h3>gtk_builder_value_from_string_type ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_builder_value_from_string_type (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Like <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string" title="gtk_builder_value_from_string ()"><code class="function">gtk_builder_value_from_string()</code></a>, this function demarshals
a value from a string, but takes a <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> instead of <a href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a>.
This function calls <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a> on the <em class="parameter"><code>value</code></em> argument, so it
need not be initialised beforehand.
</p>
<p>
Upon errors <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the <a href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of the value
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>the string representation of the value
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>the <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> to store the result in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> return location for an error, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>. </td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2" title="GTK_BUILDER_WARN_INVALID_CHILD_TYPE()">
<a name="GTK-BUILDER-WARN-INVALID-CHILD-TYPE:CAPS"></a><h3>GTK_BUILDER_WARN_INVALID_CHILD_TYPE()</h3>
<pre class="programlisting">#define GTK_BUILDER_WARN_INVALID_CHILD_TYPE(object, type)</pre>
<p>
This macro should be used to emit a warning about and unexpected
<em class="parameter"><code>type</code></em> value in a <a class="link" href="gtk-gtkbuildable.html#GtkBuildable"><span class="type">GtkBuildable</span></a> add_child implementation.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>the <a class="link" href="gtk-gtkbuildable.html#GtkBuildable"><span class="type">GtkBuildable</span></a> on which the warning ocurred
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the unexpected type value
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GTK_BUILDER_ERROR">
<a name="GTK-BUILDER-ERROR:CAPS"></a><h3>GTK_BUILDER_ERROR</h3>
<pre class="programlisting">#define GTK_BUILDER_ERROR (gtk_builder_error_quark ())
</pre>
<p>
The <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> quark for <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> errors
</p>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="GtkBuilder.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "translation-domain" property'>
<a name="GtkBuilder--translation-domain"></a><h3>The <code class="literal">"translation-domain"</code> property</h3>
<pre class="programlisting"> "translation-domain" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre>
<p>
The translation domain used when translating property values that
have been marked as translatable in interface descriptions.
If the translation domain is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> uses <code class="function">gettext()</code>,
otherwise <a href="/usr/share/gtk-doc/html/glib/glib-I18N.html#g-dgettext"><code class="function">g_dgettext()</code></a>.
</p>
<p>Default value: NULL</p>
<p class="since">Since 2.12</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.14</div>
</body>
</html>
|