~ubuntu-branches/ubuntu/karmic/gtk+2.0/karmic

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
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Main loop and Events</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="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="prev" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="next" href="gtk-Keyboard-Accelerators.html" title="Accelerator Groups">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
<link rel="chapter" href="ch02.html" title="Widget Gallery">
<link rel="chapter" href="WindowWidgets.html" title="Windows">
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
<link rel="chapter" href="Ornaments.html" title="Ornaments">
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
<link rel="chapter" href="Printing.html" title="Printing">
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
<link rel="chapter" href="Builder.html" title="Interface builder">
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry">
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
<link rel="chapter" href="gtk-migrating-GtkBuilder.html" title="Migrating from libglade to GtkBuilder">
<link rel="chapter" href="gtk-migrating-tooltips.html" title="Migrating from GtkTooltips to GtkTooltip">
<link rel="chapter" href="gtk-migrating-entry-icons.html" title="Migrating from SexyIconEntry to GtkEntry">
<link rel="chapter" href="gtk-migrating-label-links.html" title="Migrating from SexyUrlLabel to GtkLabel">
<link rel="chapter" href="gtk-migrating-ClientSideWindows.html" title="Migrating to client-side windows">
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
<link rel="glossary" href="glossary.html" title="Glossary">
<link rel="index" href="api-index-full.html" title="Index of all symbols">
<link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
<link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
<link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
<link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
<link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
<link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
<link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
<link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
<link rel="index" href="api-index-2-16.html" title="Index of new symbols in 2.16">
<link rel="index" href="api-index-2-18.html" title="Index of new symbols in 2.18">
</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="gtkbase.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gtkbase.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="gtk-Keyboard-Accelerators.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk-General.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#gtk-General.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Main loop and Events">
<a name="gtk-General"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk-General.top_of_page"></a>Main loop and Events</span></h2>
<p>Main loop and Events — Library initialization, main event loop, and events</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="gtk-General.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;gtk/gtk.h&gt;

<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *             <a class="link" href="gtk-General.html#gtk-set-locale" title="gtk_set_locale ()">gtk_set_locale</a>                      (void);
void                <a class="link" href="gtk-General.html#gtk-disable-setlocale" title="gtk_disable_setlocale ()">gtk_disable_setlocale</a>               (void);
<a
href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"
>PangoLanguage</a> *     <a class="link" href="gtk-General.html#gtk-get-default-language" title="gtk_get_default_language ()">gtk_get_default_language</a>            (void);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-parse-args" title="gtk_parse_args ()">gtk_parse_args</a>                      (int *argc,
                                                         char ***argv);
void                <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()">gtk_init</a>                            (int *argc,
                                                         char ***argv);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()">gtk_init_check</a>                      (int *argc,
                                                         char ***argv);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-init-with-args" title="gtk_init_with_args ()">gtk_init_with_args</a>                  (int *argc,
                                                         char ***argv,
                                                         char *parameter_string,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"
>GOptionEntry</a> *entries,
                                                         char *translation_domain,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"
>GOptionGroup</a> *      <a class="link" href="gtk-General.html#gtk-get-option-group" title="gtk_get_option_group ()">gtk_get_option_group</a>                (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a> open_default_display);
void                <a class="link" href="gtk-General.html#gtk-exit" title="gtk_exit ()">gtk_exit</a>                            (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> error_code);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-events-pending" title="gtk_events_pending ()">gtk_events_pending</a>                  (void);
void                <a class="link" href="gtk-General.html#gtk-main" title="gtk_main ()">gtk_main</a>                            (void);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-main-level" title="gtk_main_level ()">gtk_main_level</a>                      (void);
void                <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()">gtk_main_quit</a>                       (void);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-main-iteration" title="gtk_main_iteration ()">gtk_main_iteration</a>                  (void);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-main-iteration-do" title="gtk_main_iteration_do ()">gtk_main_iteration_do</a>               (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a> blocking);
void                <a class="link" href="gtk-General.html#gtk-main-do-event" title="gtk_main_do_event ()">gtk_main_do_event</a>                   (<a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
>GdkEvent</a> *event);
void                (<a class="link" href="gtk-General.html#GtkModuleInitFunc" title="GtkModuleInitFunc ()">*GtkModuleInitFunc</a>)                (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> *argc,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> ***argv);
void                (<a class="link" href="gtk-General.html#GtkModuleDisplayInitFunc" title="GtkModuleDisplayInitFunc ()">*GtkModuleDisplayInitFunc</a>)         (<a
href="http://library.gnome.org/devel/gdk/unstable/GdkDisplay.html"
>GdkDisplay</a> *display);

<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-true" title="gtk_true ()">gtk_true</a>                            (void);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-false" title="gtk_false ()">gtk_false</a>                           (void);

void                <a class="link" href="gtk-General.html#gtk-grab-add" title="gtk_grab_add ()">gtk_grab_add</a>                        (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);
<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          <a class="link" href="gtk-General.html#gtk-grab-get-current" title="gtk_grab_get_current ()">gtk_grab_get_current</a>                (void);
void                <a class="link" href="gtk-General.html#gtk-grab-remove" title="gtk_grab_remove ()">gtk_grab_remove</a>                     (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);

void                <a class="link" href="gtk-General.html#gtk-init-add" title="gtk_init_add ()">gtk_init_add</a>                        (<a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);
void                <a class="link" href="gtk-General.html#gtk-quit-add-destroy" title="gtk_quit_add_destroy ()">gtk_quit_add_destroy</a>                (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> main_level,
                                                         <a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-quit-add" title="gtk_quit_add ()">gtk_quit_add</a>                        (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> main_level,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-quit-add-full" title="gtk_quit_add_full ()">gtk_quit_add_full</a>                   (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> main_level,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()">GtkCallbackMarshal</a> marshal,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);
void                <a class="link" href="gtk-General.html#gtk-quit-remove" title="gtk_quit_remove ()">gtk_quit_remove</a>                     (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> quit_handler_id);
void                <a class="link" href="gtk-General.html#gtk-quit-remove-by-data" title="gtk_quit_remove_by_data ()">gtk_quit_remove_by_data</a>             (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);

<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-timeout-add-full" title="gtk_timeout_add_full ()">gtk_timeout_add_full</a>                (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"
>guint32</a> interval,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()">GtkCallbackMarshal</a> marshal,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-timeout-add" title="gtk_timeout_add ()">gtk_timeout_add</a>                     (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"
>guint32</a> interval,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);
void                <a class="link" href="gtk-General.html#gtk-timeout-remove" title="gtk_timeout_remove ()">gtk_timeout_remove</a>                  (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> timeout_handler_id);

<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-idle-add" title="gtk_idle_add ()">gtk_idle_add</a>                        (<a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-idle-add-priority" title="gtk_idle_add_priority ()">gtk_idle_add_priority</a>               (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> priority,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-idle-add-full" title="gtk_idle_add_full ()">gtk_idle_add_full</a>                   (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> priority,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()">GtkCallbackMarshal</a> marshal,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);
void                <a class="link" href="gtk-General.html#gtk-idle-remove" title="gtk_idle_remove ()">gtk_idle_remove</a>                     (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> idle_handler_id);
void                <a class="link" href="gtk-General.html#gtk-idle-remove-by-data" title="gtk_idle_remove_by_data ()">gtk_idle_remove_by_data</a>             (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);

<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-input-add-full" title="gtk_input_add_full ()">gtk_input_add_full</a>                  (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> source,
                                                         <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Input.html#GdkInputCondition"
>GdkInputCondition</a> condition,
                                                         <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Input.html#GdkInputFunction"
>GdkInputFunction</a> function,
                                                         <a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()">GtkCallbackMarshal</a> marshal,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);
void                <a class="link" href="gtk-General.html#gtk-input-remove" title="gtk_input_remove ()">gtk_input_remove</a>                    (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> input_handler_id);

#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-REDRAW--CAPS" title="GTK_PRIORITY_REDRAW">GTK_PRIORITY_REDRAW</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-RESIZE--CAPS" title="GTK_PRIORITY_RESIZE">GTK_PRIORITY_RESIZE</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-HIGH--CAPS" title="GTK_PRIORITY_HIGH">GTK_PRIORITY_HIGH</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-INTERNAL--CAPS" title="GTK_PRIORITY_INTERNAL">GTK_PRIORITY_INTERNAL</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-DEFAULT--CAPS" title="GTK_PRIORITY_DEFAULT">GTK_PRIORITY_DEFAULT</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-LOW--CAPS" title="GTK_PRIORITY_LOW">GTK_PRIORITY_LOW</a>

<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="gtk-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()">gtk_key_snooper_install</a>             (<a class="link" href="gtk-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()">GtkKeySnoopFunc</a> snooper,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> func_data);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a>                (<a class="link" href="gtk-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()">*GtkKeySnoopFunc</a>)                  (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *grab_widget,
                                                         <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEventKey"
>GdkEventKey</a> *event,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> func_data);
void                <a class="link" href="gtk-General.html#gtk-key-snooper-remove" title="gtk_key_snooper_remove ()">gtk_key_snooper_remove</a>              (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> snooper_handler_id);

<a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
>GdkEvent</a>*           <a class="link" href="gtk-General.html#gtk-get-current-event" title="gtk_get_current_event ()">gtk_get_current_event</a>               (void);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"
>guint32</a>             <a class="link" href="gtk-General.html#gtk-get-current-event-time" title="gtk_get_current_event_time ()">gtk_get_current_event_time</a>          (void);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-General.html#gtk-get-current-event-state" title="gtk_get_current_event_state ()">gtk_get_current_event_state</a>         (<a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#GdkModifierType"
>GdkModifierType</a> *state);
<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          <a class="link" href="gtk-General.html#gtk-get-event-widget" title="gtk_get_event_widget ()">gtk_get_event_widget</a>                (<a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
>GdkEvent</a> *event);
void                <a class="link" href="gtk-General.html#gtk-propagate-event" title="gtk_propagate_event ()">gtk_propagate_event</a>                 (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget,
                                                         <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
>GdkEvent</a> *event);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="gtk-General.description"></a><h2>Description</h2>
<p>
Before using GTK+, you need to initialize it; initialization connects
to the window system display, and parses some standard command line
arguments. The <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> function initializes GTK+. <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> exits
the application if errors occur; to avoid this, use <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>.
<a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a> allows you to recover from a failed GTK+
initialization - you might start up your application in text mode instead.
</p>
<p>
Like all GUI toolkits, GTK+ uses an event-driven programming
model. When the user is doing nothing, GTK+ sits in the
<em class="firstterm">main loop</em> and waits for input. If the user
performs some action - say, a mouse click - then the main loop "wakes
up" and delivers an event to GTK+. GTK+ forwards the event to one or
more widgets.
</p>
<p>
When widgets receive an event, they frequently emit one or more
<em class="firstterm">signals</em>. Signals notify your program that
"something interesting happened" by invoking functions you've
connected to the signal with <a
href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect"
><code class="function">g_signal_connect()</code></a>. Functions connected
to a signal are often termed <em class="firstterm">callbacks</em>.
</p>
<p>
When your callbacks are invoked, you would typically take some action
- for example, when an Open button is clicked you might display a
<span class="type">GtkFileSelectionDialog</span>. After a callback finishes, GTK+ will return
to the main loop and await more user input.
</p>
<div class="example">
<a name="id536205"></a><p class="title"><b>Example 2. Typical <code class="function">main</code> function for a GTK+ application</b></p>
<div class="example-contents"><pre class="programlisting">
int
main (int argc, char **argv)
{
  /* Initialize i18n support */
  gtk_set_locale ();
  /* Initialize the widget set */
  gtk_init (&amp;argc, &amp;argv);
  /* Create the main window */
  mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  /* Set up our GUI elements */
  ...
  /* Show the application window */
  gtk_widget_show_all (mainwin);
  /* Enter the main event loop, and wait for user interaction */
  gtk_main ();
  /* The user lost interest */
  return 0;
}
</pre></div>
</div>
<br class="example-break"><p>
It's OK to use the GLib main loop directly instead of <a class="link" href="gtk-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>,
though it involves slightly more typing. See <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"
><span class="type">GMainLoop</span></a> in the GLib
documentation.
</p>
</div>
<div class="refsect1" title="Details">
<a name="gtk-General.details"></a><h2>Details</h2>
<div class="refsect2" title="gtk_set_locale ()">
<a name="gtk-set-locale"></a><h3>gtk_set_locale ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *             gtk_set_locale                      (void);</pre>
<p>
Initializes internationalization support for GTK+. <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>
automatically does this, so there is typically no point
in calling this function.
</p>
<p>
If you are calling this function because you changed the locale
after GTK+ is was initialized, then calling this function
may help a bit. (Note, however, that changing the locale
after GTK+ is initialized may produce inconsistent results and
is not really supported.)
</p>
<p>
In detail - sets the current locale according to the
program environment. This is the same as calling the C library function
<code class="literal">setlocale (LC_ALL, "")</code> but also takes care of the 
locale specific setup of the windowing system used by GDK.</p>
<p>
</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 string corresponding to the locale set, typically in the
form lang_COUNTRY, where lang is an ISO-639 language code, and
COUNTRY is an ISO-3166 country code. On Unix, this form matches the
result of the <a
href="http://library.gnome.org/devel/glib/unstable/glib-running.html#setlocale"
><code class="function">setlocale()</code></a>; it is also used on other machines, such as 
Windows, where the C library returns a different result. The string is 
owned by GTK+ and should not be modified or freed.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_disable_setlocale ()">
<a name="gtk-disable-setlocale"></a><h3>gtk_disable_setlocale ()</h3>
<pre class="programlisting">void                gtk_disable_setlocale               (void);</pre>
<p>
Prevents <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>, <a class="link" href="gtk-General.html#gtk-init-with-args" title="gtk_init_with_args ()"><code class="function">gtk_init_with_args()</code></a> and
<a class="link" href="gtk-General.html#gtk-parse-args" title="gtk_parse_args ()"><code class="function">gtk_parse_args()</code></a> from automatically
calling <code class="literal">setlocale (LC_ALL, "")</code>. You would 
want to use this function if you wanted to set the locale for 
your program to something other than the user's locale, or if 
you wanted to set different values for different locale categories.
</p>
<p>
Most programs should not need to call this function.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="gtk_get_default_language ()">
<a name="gtk-get-default-language"></a><h3>gtk_get_default_language ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"
>PangoLanguage</a> *     gtk_get_default_language            (void);</pre>
<p>
Returns the <a
href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"
><span class="type">PangoLanguage</span></a> for the default language currently in
effect. (Note that this can change over the life of an
application.)  The default language is derived from the current
locale. It determines, for example, whether GTK+ uses the
right-to-left or left-to-right text direction.
</p>
<p>
This function is equivalent to <a
href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#pango-language-get-default"
><code class="function">pango_language_get_default()</code></a>.  See
that function for details.</p>
<p>
</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> the default language as a <a
href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"
><span class="type">PangoLanguage</span></a>, must not be
freed
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_parse_args ()">
<a name="gtk-parse-args"></a><h3>gtk_parse_args ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_parse_args                      (int *argc,
                                                         char ***argv);</pre>
<p>
Parses command line arguments, and initializes global
attributes of GTK+, but does not actually open a connection
to a display. (See <a
href="http://library.gnome.org/devel/gdk/unstable/GdkDisplay.html#gdk-display-open"
><code class="function">gdk_display_open()</code></a>, <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-General.html#gdk-get-display-arg-name"
><code class="function">gdk_get_display_arg_name()</code></a>)
</p>
<p>
Any arguments used by GTK+ or GDK are removed from the array and
<em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are updated accordingly.
</p>
<p>
You shouldn't call this function explicitely if you are using
<a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, or <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td> a pointer to the number of command line arguments.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td> a pointer to the array of command line arguments.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if initialization succeeded, otherwise <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_init ()">
<a name="gtk-init"></a><h3>gtk_init ()</h3>
<pre class="programlisting">void                gtk_init                            (int *argc,
                                                         char ***argv);</pre>
<p>
Call this function before using any other GTK+ functions in your GUI
applications.  It will initialize everything needed to operate the 
toolkit and parses some standard command line options. <em class="parameter"><code>argc</code></em> and 
<em class="parameter"><code>argv</code></em> are adjusted accordingly so your own code will 
never see those standard arguments. 
</p>
<p>
Note that there are some alternative ways to initialize GTK+: 
if you are calling <a class="link" href="gtk-General.html#gtk-parse-args" title="gtk_parse_args ()"><code class="function">gtk_parse_args()</code></a>, <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>, 
<a class="link" href="gtk-General.html#gtk-init-with-args" title="gtk_init_with_args ()"><code class="function">gtk_init_with_args()</code></a> or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-parse"
><code class="function">g_option_context_parse()</code></a> with 
the option group returned by <a class="link" href="gtk-General.html#gtk-get-option-group" title="gtk_get_option_group ()"><code class="function">gtk_get_option_group()</code></a>, you 
<span class="emphasis"><em>don't</em></span> have to call <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>.
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
This function will terminate your program if it was unable to initialize 
the GUI for some reason. If you want your program to fall back to a 
textual interface you want to call <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a> instead.
</p>
</div>
<p>
</p>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
Since 2.18, GTK+ calls <code class="literal">signal (SIGPIPE, SIG_IGN)</code>
during initialization, to ignore SIGPIPE signals, since these are
almost never wanted in graphical applications. If you do need to
handle SIGPIPE for some reason, reset the handler after <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>,
but notice that other libraries (e.g. libdbus or gvfs) might do
similar things.
</p>
</div>
<p>
</p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
</p>
</div>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td> Address of the <em class="parameter"><code>argc</code></em> parameter of your 
  <code class="function">main()</code> function. Changed if any arguments were handled.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td> Address of the <em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>. 
  Any parameters understood by <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> are stripped before return.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_init_check ()">
<a name="gtk-init-check"></a><h3>gtk_init_check ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_init_check                      (int *argc,
                                                         char ***argv);</pre>
<p>
This function does the same work as <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> with only 
a single change: It does not terminate the program if the GUI can't be 
initialized. Instead it returns <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> on failure.
</p>
<p>
This way the application can fall back to some other means of communication 
with the user - for example a curses or command line interface.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td> Address of the <em class="parameter"><code>argc</code></em> parameter of your 
  <code class="function">main()</code> function. Changed if any arguments were handled.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td> Address of the <em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>. 
  Any parameters understood by <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> are stripped before return.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the GUI has been successfully initialized, 
              <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_init_with_args ()">
<a name="gtk-init-with-args"></a><h3>gtk_init_with_args ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_init_with_args                  (int *argc,
                                                         char ***argv,
                                                         char *parameter_string,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"
>GOptionEntry</a> *entries,
                                                         char *translation_domain,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
This function does the same work as <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>. 
Additionally, it allows you to add your own commandline options, 
and it automatically generates nicely formatted 
<code class="option">--help</code> output. Note that your program will
be terminated after writing out the help output.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td> a pointer to the number of command line arguments.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td> a pointer to the array of command line arguments.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>parameter_string</code></em> :</span></p></td>
<td> a string which is displayed in
   the first line of <code class="option">--help</code> output, after 
   <code class="literal"><em class="replaceable"><code>programname</code></em> [OPTION...]</code>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>entries</code></em> :</span></p></td>
<td> a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>-terminated array of <a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"
><span class="type">GOptionEntry</span></a>s
   describing the options of your program
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>translation_domain</code></em> :</span></p></td>
<td> a translation domain to use for translating
   the <code class="option">--help</code> output for the options in <em class="parameter"><code>entries</code></em>
   with <a
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
><code class="function">gettext()</code></a>, or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> a return location for errors 
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the GUI has been successfully initialized, 
              <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> otherwise.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2" title="gtk_get_option_group ()">
<a name="gtk-get-option-group"></a><h3>gtk_get_option_group ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"
>GOptionGroup</a> *      gtk_get_option_group                (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a> open_default_display);</pre>
<p>
Returns a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"
><span class="type">GOptionGroup</span></a> for the commandline arguments recognized
by GTK+ and GDK. You should add this group to your <a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionContext"
><span class="type">GOptionContext</span></a> 
with <a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-add-group"
><code class="function">g_option_context_add_group()</code></a>, if you are using 
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-parse"
><code class="function">g_option_context_parse()</code></a> to parse your commandline arguments.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>open_default_display</code></em> :</span></p></td>
<td> whether to open the default display 
   when parsing the commandline arguments
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"
><span class="type">GOptionGroup</span></a> for the commandline arguments recognized
  by GTK+

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2" title="gtk_exit ()">
<a name="gtk-exit"></a><h3>gtk_exit ()</h3>
<pre class="programlisting">void                gtk_exit                            (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> error_code);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_exit</code> is deprecated and should not be used in newly-written code. Use the standard <code class="function">exit()</code> function instead.</p>
</div>
<p>
Terminates the program and returns the given exit code to the caller.
This function will shut down the GUI and free all resources allocated
for GTK+.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>error_code</code></em> :</span></p></td>
<td>Return value to pass to the caller. This is dependent on the
target system but at least on Unix systems <code class="literal">0</code> means success.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_events_pending ()">
<a name="gtk-events-pending"></a><h3>gtk_events_pending ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_events_pending                  (void);</pre>
<p>
Checks if any events are pending. This can be used to update the GUI
and invoke timeouts etc. while doing some time intensive computation.
</p>
<div class="example">
<a name="id537726"></a><p class="title"><b>Example 3. Updating the GUI during a long computation.</b></p>
<div class="example-contents"><pre class="programlisting">
	/* computation going on */
...
        while (gtk_events_pending ())
	  gtk_main_iteration ();
...
	/* computation continued */
</pre></div>
</div>
<br class="example-break"><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>%TRUE if any events are pending, <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> otherwise.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_main ()">
<a name="gtk-main"></a><h3>gtk_main ()</h3>
<pre class="programlisting">void                gtk_main                            (void);</pre>
<p>
Runs the main loop until <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> is called. You can nest calls to
<a class="link" href="gtk-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>. In that case <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> will make the innermost invocation
of the main loop return.
</p>
</div>
<hr>
<div class="refsect2" title="gtk_main_level ()">
<a name="gtk-main-level"></a><h3>gtk_main_level ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_main_level                      (void);</pre>
<p>
Asks for the current nesting level of the main loop. This can be useful
when calling <a class="link" href="gtk-General.html#gtk-quit-add" title="gtk_quit_add ()"><code class="function">gtk_quit_add()</code></a>.
</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>the nesting level of the current invocation of the main loop.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_main_quit ()">
<a name="gtk-main-quit"></a><h3>gtk_main_quit ()</h3>
<pre class="programlisting">void                gtk_main_quit                       (void);</pre>
<p>
Makes the innermost invocation of the main loop return when it regains
control.
</p>
</div>
<hr>
<div class="refsect2" title="gtk_main_iteration ()">
<a name="gtk-main-iteration"></a><h3>gtk_main_iteration ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_main_iteration                  (void);</pre>
<p>
Runs a single iteration of the mainloop. If no events are waiting to be
processed GTK+ will block until the next event is noticed. If you don't
want to block look at <a class="link" href="gtk-General.html#gtk-main-iteration-do" title="gtk_main_iteration_do ()"><code class="function">gtk_main_iteration_do()</code></a> or check if any events are
pending with <a class="link" href="gtk-General.html#gtk-events-pending" title="gtk_events_pending ()"><code class="function">gtk_events_pending()</code></a> first.
</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>%TRUE if <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> has been called for the innermost mainloop.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_main_iteration_do ()">
<a name="gtk-main-iteration-do"></a><h3>gtk_main_iteration_do ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_main_iteration_do               (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a> blocking);</pre>
<p>
Runs a single iteration of the mainloop. If no events are available either
return or block dependent on the value of <em class="parameter"><code>blocking</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>blocking</code></em> :</span></p></td>
<td>%TRUE if you want GTK+ to block if no events are pending.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>%TRUE if <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> has been called for the innermost mainloop.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_main_do_event ()">
<a name="gtk-main-do-event"></a><h3>gtk_main_do_event ()</h3>
<pre class="programlisting">void                gtk_main_do_event                   (<a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
>GdkEvent</a> *event);</pre>
<p>
Processes a single GDK event. This is public only to allow filtering of events
between GDK and GTK+. You will not usually need to call this function directly.
</p>
<p>
While you should not call this function directly, you might want to know
how exactly events are handled. So here is what this function does with
the event:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>
  Compress enter/leave notify events. If the event passed build an
  enter/leave pair together with the next event (peeked from GDK)
  both events are thrown away. This is to avoid a backlog of (de-)highlighting
  widgets crossed by the pointer.
</p></li>
<li class="listitem"><p>
  Find the widget which got the event. If the widget can't be determined
  the event is thrown away unless it belongs to a INCR transaction. In that
  case it is passed to <code class="function">gtk_selection_incr_event()</code>.
</p></li>
<li class="listitem"><p>
  Then the event is passed on a stack so you can query the currently handled
  event with <a class="link" href="gtk-General.html#gtk-get-current-event" title="gtk_get_current_event ()"><code class="function">gtk_get_current_event()</code></a>.
</p></li>
<li class="listitem">
<p>
  The event is sent to a widget. If a grab is active all events for
  widgets that are not in the contained in the grab widget are sent to the
  latter with a few exceptions:
  </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
    Deletion and destruction events are still sent to the event widget for
    obvious reasons.
  </p></li>
<li class="listitem"><p>
    Events which directly relate to the visual representation of the event
    widget.
  </p></li>
<li class="listitem"><p>
    Leave events are delivered to the event widget if there was an enter
    event delivered to it before without the paired leave event.
  </p></li>
<li class="listitem"><p>
    Drag events are not redirected because it is unclear what the semantics
    of that would be.
  </p></li>
</ul></div>
<p>
  Another point of interest might be that all key events are first passed
  through the key snooper functions if there are any. Read the description
  of <a class="link" href="gtk-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()"><code class="function">gtk_key_snooper_install()</code></a> if you need this feature.
</p>
</li>
<li class="listitem"><p>
  After finishing the delivery the event is popped from the event stack.
</p></li>
</ol></div>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td>An event to process (normally) passed by GDK.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GtkModuleInitFunc ()">
<a name="GtkModuleInitFunc"></a><h3>GtkModuleInitFunc ()</h3>
<pre class="programlisting">void                (*GtkModuleInitFunc)                (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> *argc,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> ***argv);</pre>
<p>
Each GTK+ module must have a function <code class="function">gtk_module_init()</code> with this prototype.
This function is called after loading the module with the <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em>
cleaned from any arguments that GTK+ handles itself.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>Pointer to the number of arguments remaining after <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>Points to the argument vector.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GtkModuleDisplayInitFunc ()">
<a name="GtkModuleDisplayInitFunc"></a><h3>GtkModuleDisplayInitFunc ()</h3>
<pre class="programlisting">void                (*GtkModuleDisplayInitFunc)         (<a
href="http://library.gnome.org/devel/gdk/unstable/GdkDisplay.html"
>GdkDisplay</a> *display);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>display</code></em> :</span></p></td>
<td>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.2</p>
</div>
<hr>
<div class="refsect2" title="gtk_true ()">
<a name="gtk-true"></a><h3>gtk_true ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_true                            (void);</pre>
<p>
All this function does it to return <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a>. This can be useful for example
if you want to inhibit the deletion of a window. Of course you should
not do this as the user expects a reaction from clicking the close
icon of the window...
</p>
<div class="example">
<a name="id552893"></a><p class="title"><b>Example 4. A persistent window</b></p>
<div class="example-contents"><pre class="programlisting">
##include &lt;gtk/gtk.h&gt;
int
main (int argc, char **argv)
{
  GtkWidget     *win, *but;
  gtk_init( &amp;argc, &amp;argv );
  win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  g_signal_connect (win, "delete-event",
                    G_CALLBACK (gtk_true), NULL);
  g_signal_connect (win, "destroy",
		    G_CALLBACK (gtk_main_quit), NULL);
  but = gtk_button_new_with_label ("Close yourself. I mean it!");
  g_signal_connect_swapped (but, "clicked",
		  G_CALLBACK (gtk_object_destroy), win);
  gtk_container_add (GTK_CONTAINER (win), but);
  gtk_widget_show_all (win);
  gtk_main ();
  return 0;
}
</pre></div>
</div>
<br class="example-break"><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>%TRUE
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_false ()">
<a name="gtk-false"></a><h3>gtk_false ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_false                           (void);</pre>
<p>
Analogical to <a class="link" href="gtk-General.html#gtk-true" title="gtk_true ()"><code class="function">gtk_true()</code></a> this function does nothing
but always returns <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a>.
</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>%FALSE
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_grab_add ()">
<a name="gtk-grab-add"></a><h3>gtk_grab_add ()</h3>
<pre class="programlisting">void                gtk_grab_add                        (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);</pre>
<p>
Makes <em class="parameter"><code>widget</code></em> the current grabbed widget. This means that interaction with
other widgets in the same application is blocked and mouse as well as
keyboard events are delivered to this widget.
</p>
<p>
If <em class="parameter"><code>widget</code></em> is not sensitive, it is not set as the current grabbed
widget and this function does nothing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
<td>The widget that grabs keyboard and pointer events.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_grab_get_current ()">
<a name="gtk-grab-get-current"></a><h3>gtk_grab_get_current ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_grab_get_current                (void);</pre>
<p>
Queries the current grab of the default window group.
</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>The widget which currently has the grab or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> if no grab is active.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_grab_remove ()">
<a name="gtk-grab-remove"></a><h3>gtk_grab_remove ()</h3>
<pre class="programlisting">void                gtk_grab_remove                     (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);</pre>
<p>
Removes the grab from the given widget. You have to pair calls to <a class="link" href="gtk-General.html#gtk-grab-add" title="gtk_grab_add ()"><code class="function">gtk_grab_add()</code></a>
and <a class="link" href="gtk-General.html#gtk-grab-remove" title="gtk_grab_remove ()"><code class="function">gtk_grab_remove()</code></a>.
</p>
<p>
If <em class="parameter"><code>widget</code></em> does not have the grab, this function does nothing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
<td>The widget which gives up the grab.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_init_add ()">
<a name="gtk-init-add"></a><h3>gtk_init_add ()</h3>
<pre class="programlisting">void                gtk_init_add                        (<a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<p>
Registers a function to be called when the mainloop is started.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>Function to invoke when <a class="link" href="gtk-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a> is called next.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Data to pass to that function.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_quit_add_destroy ()">
<a name="gtk-quit-add-destroy"></a><h3>gtk_quit_add_destroy ()</h3>
<pre class="programlisting">void                gtk_quit_add_destroy                (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> main_level,
                                                         <a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object);</pre>
<p>
Trigger destruction of <em class="parameter"><code>object</code></em> in case the mainloop at level <em class="parameter"><code>main_level</code></em>
is quit.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>main_level</code></em> :</span></p></td>
<td>Level of the mainloop which shall trigger the destruction.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>Object to be destroyed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_quit_add ()">
<a name="gtk-quit-add"></a><h3>gtk_quit_add ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_quit_add                        (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> main_level,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<p>
Registers a function to be called when an instance of the mainloop is left.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>main_level</code></em> :</span></p></td>
<td>Level at which termination the function shall be called. You
 can pass 0 here to have the function run at the termination of the current
 mainloop.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call. This should return 0 to be removed from the 
 list of quit handlers. Otherwise the function might be called again.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Pointer to pass when calling <em class="parameter"><code>function</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A handle for this quit handler (you need this for <a class="link" href="gtk-General.html#gtk-quit-remove" title="gtk_quit_remove ()"><code class="function">gtk_quit_remove()</code></a>)
  or 0 if you passed a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> pointer in <em class="parameter"><code>function</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_quit_add_full ()">
<a name="gtk-quit-add-full"></a><h3>gtk_quit_add_full ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_quit_add_full                   (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> main_level,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()">GtkCallbackMarshal</a> marshal,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);</pre>
<p>
Registers a function to be called when an instance of the mainloop is left.
In comparison to <a class="link" href="gtk-General.html#gtk-quit-add" title="gtk_quit_add ()"><code class="function">gtk_quit_add()</code></a> this function adds the possibility to
pass a marshaller and a function to be called when the quit handler is freed.
</p>
<p>
The former can be used to run interpreted code instead of a compiled function
while the latter can be used to free the information stored in <em class="parameter"><code>data</code></em> (while
you can do this in <em class="parameter"><code>function</code></em> as well)... So this function will mostly be
used by GTK+ wrappers for languages other than C.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>main_level</code></em> :</span></p></td>
<td>Level at which termination the function shall be called. You
 can pass 0 here to have the function run at the termination of the current
 mainloop.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call. This should return 0 to be removed from the 
 list of quit handlers. Otherwise the function might be called again.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
<td>The marshaller to be used. If this is non-<a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>, <em class="parameter"><code>function</code></em> is 
 ignored.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Pointer to pass when calling <em class="parameter"><code>function</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>Function to call to destruct <em class="parameter"><code>data</code></em>. Gets <em class="parameter"><code>data</code></em> as argument.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A handle for this quit handler (you need this for <a class="link" href="gtk-General.html#gtk-quit-remove" title="gtk_quit_remove ()"><code class="function">gtk_quit_remove()</code></a>)
  or 0 if you passed a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> pointer in <em class="parameter"><code>function</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_quit_remove ()">
<a name="gtk-quit-remove"></a><h3>gtk_quit_remove ()</h3>
<pre class="programlisting">void                gtk_quit_remove                     (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> quit_handler_id);</pre>
<p>
Removes a quit handler by its identifier.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>quit_handler_id</code></em> :</span></p></td>
<td>Identifier for the handler returned when installing it.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_quit_remove_by_data ()">
<a name="gtk-quit-remove-by-data"></a><h3>gtk_quit_remove_by_data ()</h3>
<pre class="programlisting">void                gtk_quit_remove_by_data             (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<p>
Removes a quit handler identified by its <em class="parameter"><code>data</code></em> field.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>The pointer passed as <em class="parameter"><code>data</code></em> to <a class="link" href="gtk-General.html#gtk-quit-add" title="gtk_quit_add ()"><code class="function">gtk_quit_add()</code></a> or <a class="link" href="gtk-General.html#gtk-quit-add-full" title="gtk_quit_add_full ()"><code class="function">gtk_quit_add_full()</code></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_timeout_add_full ()">
<a name="gtk-timeout-add-full"></a><h3>gtk_timeout_add_full ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_timeout_add_full                (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"
>guint32</a> interval,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()">GtkCallbackMarshal</a> marshal,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_timeout_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-timeout-add-full"
><code class="function">g_timeout_add_full()</code></a> instead.</p>
</div>
<p>
Registers a function to be called periodically. The function will be called
repeatedly after <em class="parameter"><code>interval</code></em> milliseconds until it returns <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> at which
point the timeout is destroyed and will not be called again.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
<td>The time between calls to the function, in milliseconds 
	(1/1000ths of a second.)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call periodically.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
<td>The marshaller to use instead of the function (if non-<a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>The data to pass to the function.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>Function to call when the timeout is destroyed or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_timeout_add ()">
<a name="gtk-timeout-add"></a><h3>gtk_timeout_add ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_timeout_add                     (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"
>guint32</a> interval,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_timeout_add</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-timeout-add"
><code class="function">g_timeout_add()</code></a> instead.</p>
</div>
<p>
Registers a function to be called periodically. The function will be called
repeatedly after <em class="parameter"><code>interval</code></em> milliseconds until it returns <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> at which
point the timeout is destroyed and will not be called again.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
<td>The time between calls to the function, in milliseconds 
	(1/1000ths of a second.)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call periodically.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>The data to pass to the function.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_timeout_remove ()">
<a name="gtk-timeout-remove"></a><h3>gtk_timeout_remove ()</h3>
<pre class="programlisting">void                gtk_timeout_remove                  (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> timeout_handler_id);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_timeout_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-source-remove"
><code class="function">g_source_remove()</code></a> instead.</p>
</div>
<p>
Removes the given timeout destroying all information about it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>timeout_handler_id</code></em> :</span></p></td>
<td>The identifier returned when installing the timeout.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_idle_add ()">
<a name="gtk-idle-add"></a><h3>gtk_idle_add ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_idle_add                        (<a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_add</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-idle-add"
><code class="function">g_idle_add()</code></a> instead.</p>
</div>
<p>
Causes the mainloop to call the given function whenever no events with
higher priority are to be processed. The default priority is
<a class="link" href="gtk-General.html#GTK-PRIORITY-DEFAULT--CAPS" title="GTK_PRIORITY_DEFAULT"><code class="literal">GTK_PRIORITY_DEFAULT</code></a>, which is rather low.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>The information to pass to the function.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a unique handle for this registration.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_idle_add_priority ()">
<a name="gtk-idle-add-priority"></a><h3>gtk_idle_add_priority ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_idle_add_priority               (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> priority,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_add_priority</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-idle-add-full"
><code class="function">g_idle_add_full()</code></a> instead.</p>
</div>
<p>
Like <a class="link" href="gtk-General.html#gtk-idle-add" title="gtk_idle_add ()"><code class="function">gtk_idle_add()</code></a> this function allows you to have a function called
when the event loop is idle. The difference is that you can give a
priority different from <a class="link" href="gtk-General.html#GTK-PRIORITY-DEFAULT--CAPS" title="GTK_PRIORITY_DEFAULT"><code class="literal">GTK_PRIORITY_DEFAULT</code></a> to the idle function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
<td>The priority which should not be above <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH-IDLE--CAPS"
><code class="literal">G_PRIORITY_HIGH_IDLE</code></a>.
Note that you will interfere with GTK+ if you use a priority above
<a class="link" href="gtk-General.html#GTK-PRIORITY-RESIZE--CAPS" title="GTK_PRIORITY_RESIZE"><code class="literal">GTK_PRIORITY_RESIZE</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Data to pass to that function.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_idle_add_full ()">
<a name="gtk-idle-add-full"></a><h3>gtk_idle_add_full ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_idle_add_full                   (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> priority,
                                                         <a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()">GtkFunction</a> function,
                                                         <a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()">GtkCallbackMarshal</a> marshal,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-idle-add-full"
><code class="function">g_idle_add_full()</code></a> instead.</p>
</div>
<p>
Like <a class="link" href="gtk-General.html#gtk-idle-add" title="gtk_idle_add ()"><code class="function">gtk_idle_add()</code></a> this function allows you to have a function called
when the event loop is idle. The difference is that you can give a
priority different from <a class="link" href="gtk-General.html#GTK-PRIORITY-DEFAULT--CAPS" title="GTK_PRIORITY_DEFAULT"><code class="literal">GTK_PRIORITY_DEFAULT</code></a> to the idle function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
<td>The priority which should not be above <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH-IDLE--CAPS"
><code class="literal">G_PRIORITY_HIGH_IDLE</code></a>.
Note that you will interfere with GTK+ if you use a priority above
<a class="link" href="gtk-General.html#GTK-PRIORITY-RESIZE--CAPS" title="GTK_PRIORITY_RESIZE"><code class="literal">GTK_PRIORITY_RESIZE</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
<td>The marshaller to use instead of the function (if non-<a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Data to pass to that function.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>Function to call when the timeout is destroyed or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_idle_remove ()">
<a name="gtk-idle-remove"></a><h3>gtk_idle_remove ()</h3>
<pre class="programlisting">void                gtk_idle_remove                     (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> idle_handler_id);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-source-remove"
><code class="function">g_source_remove()</code></a> instead.</p>
</div>
<p>
Removes the idle function with the given id.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>idle_handler_id</code></em> :</span></p></td>
<td>Identifies the idle function to remove.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_idle_remove_by_data ()">
<a name="gtk-idle-remove-by-data"></a><h3>gtk_idle_remove_by_data ()</h3>
<pre class="programlisting">void                gtk_idle_remove_by_data             (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_remove_by_data</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-idle-remove-by-data"
><code class="function">g_idle_remove_by_data()</code></a> instead.</p>
</div>
<p>
Removes the idle function identified by the user data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>remove the idle function which was registered with this user data.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_input_add_full ()">
<a name="gtk-input-add-full"></a><h3>gtk_input_add_full ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_input_add_full                  (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a> source,
                                                         <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Input.html#GdkInputCondition"
>GdkInputCondition</a> condition,
                                                         <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Input.html#GdkInputFunction"
>GdkInputFunction</a> function,
                                                         <a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()">GtkCallbackMarshal</a> marshal,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_input_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#g-io-add-watch-full"
><code class="function">g_io_add_watch_full()</code></a> instead.</p>
</div>
<p>
Registers a function to be called when a condition becomes true
on a file descriptor.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
<td>a file descriptor.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>condition</code></em> :</span></p></td>
<td>the condition.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
<td>The marshaller to use instead of the function (if non-<a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>callback data passed to <em class="parameter"><code>function</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>callback function to call with <em class="parameter"><code>data</code></em> when the input
  handler is removed, or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source; to be used with <a class="link" href="gtk-General.html#gtk-input-remove" title="gtk_input_remove ()"><code class="function">gtk_input_remove()</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_input_remove ()">
<a name="gtk-input-remove"></a><h3>gtk_input_remove ()</h3>
<pre class="programlisting">void                gtk_input_remove                    (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> input_handler_id);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_input_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-source-remove"
><code class="function">g_source_remove()</code></a> instead.</p>
</div>
<p>
Removes the function with the given id.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>input_handler_id</code></em> :</span></p></td>
<td>Identifies the function to remove.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GTK_PRIORITY_REDRAW">
<a name="GTK-PRIORITY-REDRAW--CAPS"></a><h3>GTK_PRIORITY_REDRAW</h3>
<pre class="programlisting">#define GTK_PRIORITY_REDRAW     (G_PRIORITY_HIGH_IDLE + 20)
</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_REDRAW</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#GDK-PRIORITY-REDRAW--CAPS"
><code class="literal">GDK_PRIORITY_REDRAW</code></a> instead.</p>
</div>
<p>
Use this priority for redrawing related stuff. It is used internally by
GTK+ to do pending redraws. This priority is lower than <a class="link" href="gtk-General.html#GTK-PRIORITY-RESIZE--CAPS" title="GTK_PRIORITY_RESIZE"><code class="literal">GTK_PRIORITY_RESIZE</code></a>
to avoid redrawing a widget just before resizing (and therefore redrawing
it again).
</p>
</div>
<hr>
<div class="refsect2" title="GTK_PRIORITY_RESIZE">
<a name="GTK-PRIORITY-RESIZE--CAPS"></a><h3>GTK_PRIORITY_RESIZE</h3>
<pre class="programlisting">#define GTK_PRIORITY_RESIZE     (G_PRIORITY_HIGH_IDLE + 10)
</pre>
<p>
Use this priority for resizing related stuff. It is used internally by
GTK+ to compute the sizes of widgets. This priority is higher than
<a class="link" href="gtk-General.html#GTK-PRIORITY-REDRAW--CAPS" title="GTK_PRIORITY_REDRAW"><code class="literal">GTK_PRIORITY_REDRAW</code></a> to avoid resizing a widget which was just redrawn.
</p>
</div>
<hr>
<div class="refsect2" title="GTK_PRIORITY_HIGH">
<a name="GTK-PRIORITY-HIGH--CAPS"></a><h3>GTK_PRIORITY_HIGH</h3>
<pre class="programlisting">#define GTK_PRIORITY_HIGH       G_PRIORITY_HIGH
</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_HIGH</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH--CAPS"
><code class="literal">G_PRIORITY_HIGH</code></a> instead.</p>
</div>
<p>
Use this for high priority timeouts. This priority is never used inside
GTK+ so everything running at this priority will be running before anything
inside the toolkit.
</p>
</div>
<hr>
<div class="refsect2" title="GTK_PRIORITY_INTERNAL">
<a name="GTK-PRIORITY-INTERNAL--CAPS"></a><h3>GTK_PRIORITY_INTERNAL</h3>
<pre class="programlisting">#define GTK_PRIORITY_INTERNAL   GTK_PRIORITY_REDRAW
</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_INTERNAL</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
This priority is for GTK+ internal stuff. Don't use it in your applications.
</p>
</div>
<hr>
<div class="refsect2" title="GTK_PRIORITY_DEFAULT">
<a name="GTK-PRIORITY-DEFAULT--CAPS"></a><h3>GTK_PRIORITY_DEFAULT</h3>
<pre class="programlisting">#define GTK_PRIORITY_DEFAULT	G_PRIORITY_DEFAULT_IDLE
</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_DEFAULT</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT-IDLE--CAPS"
><code class="literal">G_PRIORITY_DEFAULT_IDLE</code></a> instead.</p>
</div>
<p>
Default priority for idle functions.
</p>
</div>
<hr>
<div class="refsect2" title="GTK_PRIORITY_LOW">
<a name="GTK-PRIORITY-LOW--CAPS"></a><h3>GTK_PRIORITY_LOW</h3>
<pre class="programlisting">#define GTK_PRIORITY_LOW	G_PRIORITY_LOW
</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_LOW</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-LOW--CAPS"
><code class="literal">G_PRIORITY_LOW</code></a> instead.</p>
</div>
<p>
Priority for very unimportant background tasks.
</p>
</div>
<hr>
<div class="refsect2" title="gtk_key_snooper_install ()">
<a name="gtk-key-snooper-install"></a><h3>gtk_key_snooper_install ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>               gtk_key_snooper_install             (<a class="link" href="gtk-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()">GtkKeySnoopFunc</a> snooper,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> func_data);</pre>
<p>
Installs a key snooper function, which will get called on all key events
before delivering them normally.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>snooper</code></em> :</span></p></td>
<td>a <a class="link" href="gtk-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td>
<td>data to pass to <em class="parameter"><code>snooper</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a unique id for this key snooper for use with <a class="link" href="gtk-General.html#gtk-key-snooper-remove" title="gtk_key_snooper_remove ()"><code class="function">gtk_key_snooper_remove()</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GtkKeySnoopFunc ()">
<a name="GtkKeySnoopFunc"></a><h3>GtkKeySnoopFunc ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
>gint</a>                (*GtkKeySnoopFunc)                  (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *grab_widget,
                                                         <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEventKey"
>GdkEventKey</a> *event,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> func_data);</pre>
<p>
Key snooper functions are called before normal event delivery.
They can be used to implement custom key event handling.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>grab_widget</code></em> :</span></p></td>
<td>the widget to which the event will be delivered.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td>the key event.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td>
<td>the <em class="parameter"><code>func_data</code></em> supplied to <a class="link" href="gtk-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()"><code class="function">gtk_key_snooper_install()</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>%TRUE to stop further processing of <em class="parameter"><code>event</code></em>, <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> to continue.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_key_snooper_remove ()">
<a name="gtk-key-snooper-remove"></a><h3>gtk_key_snooper_remove ()</h3>
<pre class="programlisting">void                gtk_key_snooper_remove              (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a> snooper_handler_id);</pre>
<p>
Removes the key snooper function with the given id.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>snooper_handler_id</code></em> :</span></p></td>
<td>Identifies the key snooper to remove.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_get_current_event ()">
<a name="gtk-get-current-event"></a><h3>gtk_get_current_event ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
>GdkEvent</a>*           gtk_get_current_event               (void);</pre>
<p>
Obtains a copy of the event currently being processed by GTK+.  For
example, if you get a "clicked" signal from <a class="link" href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a>, the current
event will be the <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEventButton"
><span class="type">GdkEventButton</span></a> that triggered the "clicked"
signal. The returned event must be freed with <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#gdk-event-free"
><code class="function">gdk_event_free()</code></a>.
If there is no current event, the function returns <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>.</p>
<p>
</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 copy of the current event, or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> if no current event.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_get_current_event_time ()">
<a name="gtk-get-current-event-time"></a><h3>gtk_get_current_event_time ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"
>guint32</a>             gtk_get_current_event_time          (void);</pre>
<p>
If there is a current event and it has a timestamp, return that
timestamp, otherwise return <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#GDK-CURRENT-TIME--CAPS"
><code class="literal">GDK_CURRENT_TIME</code></a>.</p>
<p>
</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> the timestamp from the current event, or <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#GDK-CURRENT-TIME--CAPS"
><code class="literal">GDK_CURRENT_TIME</code></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_get_current_event_state ()">
<a name="gtk-get-current-event-state"></a><h3>gtk_get_current_event_state ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_get_current_event_state         (<a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#GdkModifierType"
>GdkModifierType</a> *state);</pre>
<p>
If there is a current event and it has a state field, place
that state field in <em class="parameter"><code>state</code></em> and return <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a>, otherwise return
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
<td> a location to store the state of the current event
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if there was a current event and it had a state field
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_get_event_widget ()">
<a name="gtk-get-event-widget"></a><h3>gtk_get_event_widget ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_get_event_widget                (<a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
>GdkEvent</a> *event);</pre>
<p>
If <em class="parameter"><code>event</code></em> is <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> or the event was not associated with any widget,
returns <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>, otherwise returns the widget that received the event
originally.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td> a <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
><span class="type">GdkEvent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the widget that originally received <em class="parameter"><code>event</code></em>, or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gtk_propagate_event ()">
<a name="gtk-propagate-event"></a><h3>gtk_propagate_event ()</h3>
<pre class="programlisting">void                gtk_propagate_event                 (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget,
                                                         <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#GdkEvent"
>GdkEvent</a> *event);</pre>
<p>
Sends an event to a widget, propagating the event to parent widgets
if the event remains unhandled. Events received by GTK+ from GDK
normally begin in <a class="link" href="gtk-General.html#gtk-main-do-event" title="gtk_main_do_event ()"><code class="function">gtk_main_do_event()</code></a>. Depending on the type of
event, existence of modal dialogs, grabs, etc., the event may be
propagated; if so, this function is used. <a class="link" href="gtk-General.html#gtk-propagate-event" title="gtk_propagate_event ()"><code class="function">gtk_propagate_event()</code></a>
calls <a class="link" href="GtkWidget.html#gtk-widget-event" title="gtk_widget_event ()"><code class="function">gtk_widget_event()</code></a> on each widget it decides to send the
event to.  So <a class="link" href="GtkWidget.html#gtk-widget-event" title="gtk_widget_event ()"><code class="function">gtk_widget_event()</code></a> is the lowest-level function; it
simply emits the "event" and possibly an event-specific signal on a
widget.  <a class="link" href="gtk-General.html#gtk-propagate-event" title="gtk_propagate_event ()"><code class="function">gtk_propagate_event()</code></a> is a bit higher-level, and
<a class="link" href="gtk-General.html#gtk-main-do-event" title="gtk_main_do_event ()"><code class="function">gtk_main_do_event()</code></a> is the highest level.
</p>
<p>
All that said, you most likely don't want to use any of these
functions; synthesizing events is rarely needed. Consider asking on
the mailing list for better ways to achieve your goals. For
example, use <a
href="http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#gdk-window-invalidate-rect"
><code class="function">gdk_window_invalidate_rect()</code></a> or
<a class="link" href="GtkWidget.html#gtk-widget-queue-draw" title="gtk_widget_queue_draw ()"><code class="function">gtk_widget_queue_draw()</code></a> instead of making up expose events.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
<td> a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td> an event
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="gtk-General.see-also"></a><h2>See Also</h2>
<p>
See the GLib manual, especially <a
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"
><span class="type">GMainLoop</span></a> and signal-related
functions such as <a
href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect"
><code class="function">g_signal_connect()</code></a>.
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>