File: gtk3-General.html

package info (click to toggle)
gtk%2B3.0 3.22.11-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 182,828 kB
  • ctags: 82,378
  • sloc: ansic: 1,165,043; xml: 9,259; makefile: 6,914; sh: 5,179; python: 402; perl: 370; cpp: 34; sed: 16
file content (1510 lines) | stat: -rw-r--r-- 90,594 bytes parent folder | download
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
<!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: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="gtkbase.html" title="Part III. GTK+ Core Reference">
<link rel="prev" href="gtkbase.html" title="Part III. GTK+ Core Reference">
<link rel="next" href="gtk3-Feature-Test-Macros.html" title="Version Information">
<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gtk3-General.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gtkbase.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gtk3-Feature-Test-Macros.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gtk3-General"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-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 class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gtk3-General.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-disable-setlocale" title="gtk_disable_setlocale ()">gtk_disable_setlocale</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage-struct"><span class="returnvalue">PangoLanguage</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-get-default-language" title="gtk_get_default_language ()">gtk_get_default_language</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html#GtkTextDirection" title="enum GtkTextDirection"><span class="returnvalue">GtkTextDirection</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-get-locale-direction" title="gtk_get_locale_direction ()">gtk_get_locale_direction</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-parse-args" title="gtk_parse_args ()">gtk_parse_args</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()">gtk_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()">gtk_init_check</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-init-with-args" title="gtk_init_with_args ()">gtk_init_with_args</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-get-option-group" title="gtk_get_option_group ()">gtk_get_option_group</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-events-pending" title="gtk_events_pending ()">gtk_events_pending</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-main" title="gtk_main ()">gtk_main</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-main-level" title="gtk_main_level ()">gtk_main_level</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()">gtk_main_quit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-main-iteration" title="gtk_main_iteration ()">gtk_main_iteration</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-main-iteration-do" title="gtk_main_iteration_do ()">gtk_main_iteration_do</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-main-do-event" title="gtk_main_do_event ()">gtk_main_do_event</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="gtk3-General.html#GtkModuleInitFunc" title="GtkModuleInitFunc ()">*GtkModuleInitFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="gtk3-General.html#GtkModuleDisplayInitFunc" title="GtkModuleDisplayInitFunc ()">*GtkModuleDisplayInitFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-true" title="gtk_true ()">gtk_true</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-false" title="gtk_false ()">gtk_false</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-grab-add" title="gtk_grab_add ()">gtk_grab_add</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-grab-get-current" title="gtk_grab_get_current ()">gtk_grab_get_current</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-grab-remove" title="gtk_grab_remove ()">gtk_grab_remove</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-device-grab-add" title="gtk_device_grab_add ()">gtk_device_grab_add</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-device-grab-remove" title="gtk_device_grab_remove ()">gtk_device_grab_remove</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()">gtk_key_snooper_install</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="gtk3-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()">*GtkKeySnoopFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-key-snooper-remove" title="gtk_key_snooper_remove ()">gtk_key_snooper_remove</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/gdk3/gdk4-Event-Structures.html#GdkEvent"><span class="returnvalue">GdkEvent</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-get-current-event" title="gtk_get_current_event ()">gtk_get_current_event</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-get-current-event-time" title="gtk_get_current_event_time ()">gtk_get_current_event_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-get-current-event-state" title="gtk_get_current_event_state ()">gtk_get_current_event_state</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/gdk3/GdkDevice.html#GdkDevice-struct"><span class="returnvalue">GdkDevice</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-get-current-event-device" title="gtk_get_current_event_device ()">gtk_get_current_event_device</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-get-event-widget" title="gtk_get_event_widget ()">gtk_get_event_widget</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-General.html#gtk-propagate-event" title="gtk_propagate_event ()">gtk_propagate_event</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-General.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody><tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gtk3-General.html#GTK-PRIORITY-RESIZE:CAPS" title="GTK_PRIORITY_RESIZE">GTK_PRIORITY_RESIZE</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-General.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gtk3-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="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> macro initializes GTK+. <a class="link" href="gtk3-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="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>. <a class="link" href="gtk3-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 “main loop” 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
“signals”. Signals notify your program that "something
interesting happened" by invoking functions you’ve connected to the signal
with <a href="https://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a>. Functions connected to a signal are often termed
“callbacks”.</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
<a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a>. After a callback finishes, GTK+ will return to the
main loop and await more user input.</p>
<div class="refsect3">
<a name="id-1.4.2.6.6"></a><h4>Typical <code class="function">main()</code> function for a GTK+ application</h4>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">int</span>
<span class="function">main</span> <span class="gtkdoc opt">(</span><span class="gtkdoc kwb">int</span> argc<span class="gtkdoc opt">,</span> <span class="gtkdoc kwb">char</span> <span class="gtkdoc opt">**</span>argv<span class="gtkdoc opt">)</span>
<span class="gtkdoc opt">{</span>
  <span class="gtkdoc slc">// Initialize i18n support with bindtextdomain(), etc.</span>

  <span class="gtkdoc opt">...</span>

  <span class="gtkdoc slc">// Initialize the widget set</span>
  <span class="function"><a href="gtk3-General.html#gtk-init">gtk_init</a></span> <span class="gtkdoc opt">(&amp;</span>argc<span class="gtkdoc opt">, &amp;</span>argv<span class="gtkdoc opt">);</span>

  <span class="gtkdoc slc">// Create the main window</span>
  mainwin <span class="gtkdoc opt">=</span> <span class="function"><a href="GtkWindow.html#gtk-window-new">gtk_window_new</a></span> <span class="gtkdoc opt">(</span>GTK_WINDOW_TOPLEVEL<span class="gtkdoc opt">);</span>

  <span class="gtkdoc slc">// Set up our GUI elements</span>

  <span class="gtkdoc opt">...</span>

  <span class="gtkdoc slc">// Show the application window</span>
  <span class="function"><a href="GtkWidget.html#gtk-widget-show-all">gtk_widget_show_all</a></span> <span class="gtkdoc opt">(</span>mainwin<span class="gtkdoc opt">);</span>

  <span class="gtkdoc slc">// Enter the main event loop, and wait for user interaction</span>
  <span class="function"><a href="gtk3-General.html#gtk-main">gtk_main</a></span> <span class="gtkdoc opt">();</span>

  <span class="gtkdoc slc">// The user lost interest</span>
  <span class="keyword">return</span> <span class="number">0</span><span class="gtkdoc opt">;</span>
<span class="gtkdoc opt">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<p>It’s OK to use the GLib main loop directly instead of <a class="link" href="gtk3-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>, though it
involves slightly more typing. See <a href="https://developer.gnome.org/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> in the GLib documentation.</p>
</div>
</div>
<div class="refsect1">
<a name="gtk3-General.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-disable-setlocale"></a><h3>gtk_disable_setlocale ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_disable_setlocale (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Prevents <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>, <a class="link" href="gtk3-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="gtk3-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>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-default-language"></a><h3>gtk_get_default_language ()</h3>
<pre class="programlisting"><a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage-struct"><span class="returnvalue">PangoLanguage</span></a> *
gtk_get_default_language (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Returns the <a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage-struct"><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="/home/mclasen/gnome/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>
<div class="refsect3">
<a name="gtk-get-default-language.returns"></a><h4>Returns</h4>
<p> the default language as a <a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage-struct"><span class="type">PangoLanguage</span></a>,
must not be freed. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-locale-direction"></a><h3>gtk_get_locale_direction ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html#GtkTextDirection" title="enum GtkTextDirection"><span class="returnvalue">GtkTextDirection</span></a>
gtk_get_locale_direction (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Get the direction of the current locale. This is the expected
reading direction for text and UI.</p>
<p>This function depends on the current locale being set with
<code class="function">setlocale()</code> and will default to setting the <a class="link" href="GtkWidget.html#GTK-TEXT-DIR-LTR:CAPS"><code class="literal">GTK_TEXT_DIR_LTR</code></a>
direction otherwise. <a class="link" href="GtkWidget.html#GTK-TEXT-DIR-NONE:CAPS"><code class="literal">GTK_TEXT_DIR_NONE</code></a> will never be returned.</p>
<p>GTK+ sets the default text direction according to the locale
during <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, and you should normally use
<a class="link" href="GtkWidget.html#gtk-widget-get-direction" title="gtk_widget_get_direction ()"><code class="function">gtk_widget_get_direction()</code></a> or <a class="link" href="GtkWidget.html#gtk-widget-get-default-direction" title="gtk_widget_get_default_direction ()"><code class="function">gtk_widget_get_default_direction()</code></a>
to obtain the current direcion.</p>
<p>This function is only needed rare cases when the locale is
changed after GTK+ has already been initialized. In this case,
you can use it to update the default text direction as follows:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="function">setlocale</span> <span class="gtkdoc opt">(</span>LC_ALL<span class="gtkdoc opt">,</span> new_locale<span class="gtkdoc opt">);</span>
direction <span class="gtkdoc opt">=</span> <span class="function"><a href="gtk3-General.html#gtk-get-locale-direction">gtk_get_locale_direction</a></span> <span class="gtkdoc opt">();</span>
<span class="function"><a href="GtkWidget.html#gtk-widget-set-default-direction">gtk_widget_set_default_direction</a></span> <span class="gtkdoc opt">(</span>direction<span class="gtkdoc opt">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<div class="refsect3">
<a name="gtk-get-locale-direction.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="GtkWidget.html#GtkTextDirection" title="enum GtkTextDirection"><span class="type">GtkTextDirection</span></a> of the current locale</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-12.html#api-index-3.12">3.12</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-parse-args"></a><h3>gtk_parse_args ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_parse_args (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</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://developer.gnome.org/gdk3/GdkDisplay.html#gdk-display-open"><code class="function">gdk_display_open()</code></a>, <a href="http://developer.gnome.org/gdk3/gdk4-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>There is no need to call this function explicitly if you are using
<a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, or <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>.</p>
<p>Note that many aspects of GTK+ require a display connection to
function, so this way of initializing GTK+ is really only useful
for specialized use cases.</p>
<div class="refsect3">
<a name="gtk-parse-args.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>argc</p></td>
<td class="parameter_description"><p> a pointer to the number of command line arguments. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>argv</p></td>
<td class="parameter_description"><p> a pointer to the array of
command line arguments. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-parse-args.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if initialization succeeded, otherwise <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-init"></a><h3>gtk_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_init (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
          <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</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.</p>
<p>Although you are expected to pass the <em class="parameter"><code>argc</code></em>
, <em class="parameter"><code>argv</code></em>
 parameters from <code class="function">main()</code> to 
this function, it is possible to pass <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>argv</code></em>
 is not available or 
commandline handling is not required.</p>
<p><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="gtk3-General.html#gtk-parse-args" title="gtk_parse_args ()"><code class="function">gtk_parse_args()</code></a>, <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>,
<a class="link" href="gtk3-General.html#gtk-init-with-args" title="gtk_init_with_args ()"><code class="function">gtk_init_with_args()</code></a> or <a href="https://developer.gnome.org/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="gtk3-General.html#gtk-get-option-group" title="gtk_get_option_group ()"><code class="function">gtk_get_option_group()</code></a>,
you don’t have to call <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>.</p>
<p>And if you are using <a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a>, you don't have to call any of the
initialization functions either; the <span class="type">“startup”</span> handler
does it for you.</p>
<p>This function will terminate your program if it was unable to
initialize the windowing system for some reason. If you want
your program to fall back to a textual interface you want to
call <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a> instead.</p>
<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="gtk3-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 class="refsect3">
<a name="gtk-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>argc</p></td>
<td class="parameter_description"><p> Address of the <code class="literal">argc</code> parameter of
your <code class="function">main()</code> function (or 0 if <em class="parameter"><code>argv</code></em>
is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>). This will be changed if
any arguments were handled. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>argv</p></td>
<td class="parameter_description"><p> Address of the
<code class="literal">argv</code> parameter of <code class="function">main()</code>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Any options
understood by GTK+ are stripped before return. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-init-check"></a><h3>gtk_init_check ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_init_check (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</pre>
<p>This function does the same work as <a class="link" href="gtk3-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 windowing system
can’t be initialized. Instead it returns <a href="https://developer.gnome.org/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>
<div class="refsect3">
<a name="gtk-init-check.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>argc</p></td>
<td class="parameter_description"><p> Address of the <code class="literal">argc</code> parameter of
your <code class="function">main()</code> function (or 0 if <em class="parameter"><code>argv</code></em>
is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>). This will be changed if
any arguments were handled. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>argv</p></td>
<td class="parameter_description"><p> Address of the
<code class="literal">argv</code> parameter of <code class="function">main()</code>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Any options
understood by GTK+ are stripped before return. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-init-check.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the windowing system has been successfully
initialized, <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-init-with-args"></a><h3>gtk_init_with_args ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_init_with_args (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                    <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>,
                    <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *parameter_string</code></em>,
                    <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a> *entries</code></em>,
                    <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *translation_domain</code></em>,
                    <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>This function does the same work as <a class="link" href="gtk3-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="literal">--help</code> output. Note that your program will
be terminated after writing out the help output.</p>
<div class="refsect3">
<a name="gtk-init-with-args.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>argc</p></td>
<td class="parameter_description"><p> Address of the <code class="literal">argc</code> parameter of
your <code class="function">main()</code> function (or 0 if <em class="parameter"><code>argv</code></em>
is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>). This will be changed if
any arguments were handled. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>argv</p></td>
<td class="parameter_description"><p> Address of the
<code class="literal">argv</code> parameter of <code class="function">main()</code>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Any options
understood by GTK+ are stripped before return. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>parameter_string</p></td>
<td class="parameter_description"><p> a string which is displayed in
the first line of <code class="literal">--help</code> output, after
<code class="literal">programname [OPTION...]</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>entries</p></td>
<td class="parameter_description"><p> a <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated array
of <a href="https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntrys</span></a> describing the options of your program. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>translation_domain</p></td>
<td class="parameter_description"><p> a translation domain to use for translating
the <code class="literal">--help</code> output for the options in <em class="parameter"><code>entries</code></em>
and the <em class="parameter"><code>parameter_string</code></em>
with <code class="function">gettext()</code>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a return location for errors</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-init-with-args.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the windowing system has been successfully
initialized, <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-option-group"></a><h3>gtk_get_option_group ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *
gtk_get_option_group (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> open_default_display</code></em>);</pre>
<p>Returns a <a href="https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> for the commandline arguments recognized
by GTK+ and GDK.</p>
<p>You should add this group to your <a href="https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
with <a href="https://developer.gnome.org/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="https://developer.gnome.org/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>
<div class="refsect3">
<a name="gtk-get-option-group.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>open_default_display</p></td>
<td class="parameter_description"><p>whether to open the default display
when parsing the commandline arguments</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-get-option-group.returns"></a><h4>Returns</h4>
<p> a <a href="https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> for the commandline
arguments recognized by GTK+. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-events-pending"></a><h3>gtk_events_pending ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_events_pending (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Checks if any events are pending.</p>
<p>This can be used to update the UI and invoke timeouts etc.
while doing some time intensive computation.</p>
<div class="refsect3">
<a name="id-1.4.2.7.10.6"></a><h4>Updating the UI during a long computation</h4>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="gtkdoc slc">// computation going on...</span>

<span class="keyword">while</span> <span class="gtkdoc opt">(</span><span class="function"><a href="gtk3-General.html#gtk-events-pending">gtk_events_pending</a></span> <span class="gtkdoc opt">())</span>
  <span class="function"><a href="gtk3-General.html#gtk-main-iteration">gtk_main_iteration</a></span> <span class="gtkdoc opt">();</span>

<span class="gtkdoc slc">// ...computation continued</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
</div>
<div class="refsect3">
<a name="gtk-events-pending.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if any events are pending, <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main"></a><h3>gtk_main ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_main (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Runs the main loop until <a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> is called.</p>
<p>You can nest calls to <a class="link" href="gtk3-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>. In that case <a class="link" href="gtk3-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">
<a name="gtk-main-level"></a><h3>gtk_main_level ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gtk_main_level (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Asks for the current nesting level of the main loop.</p>
<div class="refsect3">
<a name="gtk-main-level.returns"></a><h4>Returns</h4>
<p> the nesting level of the current invocation
of the main loop</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-quit"></a><h3>gtk_main_quit ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_main_quit (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Makes the innermost invocation of the main loop return
when it regains control.</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-iteration"></a><h3>gtk_main_iteration ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_main_iteration (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Runs a single iteration of the mainloop.</p>
<p>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="gtk3-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="gtk3-General.html#gtk-events-pending" title="gtk_events_pending ()"><code class="function">gtk_events_pending()</code></a> first.</p>
<div class="refsect3">
<a name="gtk-main-iteration.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> has been called for the
innermost mainloop</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-iteration-do"></a><h3>gtk_main_iteration_do ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_main_iteration_do (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>);</pre>
<p>Runs a single iteration of the mainloop.
If no events are available either return or block depending on
the value of <em class="parameter"><code>blocking</code></em>
.</p>
<div class="refsect3">
<a name="gtk-main-iteration-do.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>blocking</p></td>
<td class="parameter_description"><p><a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if you want GTK+ to block if no events are pending</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-main-iteration-do.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> has been called for the
innermost mainloop</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-do-event"></a><h3>gtk_main_do_event ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_main_do_event (<em class="parameter"><code><a href="http://developer.gnome.org/gdk3/gdk4-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre>
<p>Processes a single GDK event.</p>
<p>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.</p></li>
<li class="listitem"><p>Then the event is pushed onto a stack so you can query the currently
handled event with <a class="link" href="gtk3-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" style="list-style-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.
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="gtk3-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>
</ul></div>
</li>
<li class="listitem"><p>After finishing the delivery the event is popped from the event stack.</p></li>
</ol></div>
<div class="refsect3">
<a name="gtk-main-do-event.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>An event to process (normally passed by GDK)</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GtkModuleInitFunc"></a><h3>GtkModuleInitFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GtkModuleInitFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                      <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);</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.</p>
<div class="refsect3">
<a name="GtkModuleInitFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>argc</p></td>
<td class="parameter_description"><p> GTK+ always passes <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for this argument. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>argv</p></td>
<td class="parameter_description"><p> GTK+ always passes <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for this argument. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GtkModuleDisplayInitFunc"></a><h3>GtkModuleDisplayInitFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GtkModuleDisplayInitFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="http://developer.gnome.org/gdk3/GdkDisplay.html#GdkDisplay-struct"><span class="type">GdkDisplay</span></a> *display</code></em>);</pre>
<p>A multihead-aware GTK+ module may have a <code class="function">gtk_module_display_init()</code> function
with this prototype. GTK+ calls this function for each opened display.</p>
<div class="refsect3">
<a name="GtkModuleDisplayInitFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>display</p></td>
<td class="parameter_description"><p>an open <a href="http://developer.gnome.org/gdk3/GdkDisplay.html#GdkDisplay-struct"><span class="type">GdkDisplay</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-true"></a><h3>gtk_true ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_true (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>All this function does it to return <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
<p>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="refsect3">
<a name="id-1.4.2.7.19.6"></a><h4>A persistent window</h4>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="gtkdoc ppc">#include &lt;gtk/gtk.h&gt;</span>

<span class="gtkdoc kwb">int</span>
<span class="function">main</span> <span class="gtkdoc opt">(</span><span class="gtkdoc kwb">int</span> argc<span class="gtkdoc opt">,</span> <span class="gtkdoc kwb">char</span> <span class="gtkdoc opt">**</span>argv<span class="gtkdoc opt">)</span>
<span class="gtkdoc opt">{</span>
  GtkWidget <span class="gtkdoc opt">*</span>win<span class="gtkdoc opt">, *</span>but<span class="gtkdoc opt">;</span>
  <span class="gtkdoc kwb">const char</span> <span class="gtkdoc opt">*</span>text <span class="gtkdoc opt">=</span> <span class="string">&quot;Close yourself. I mean it!&quot;</span><span class="gtkdoc opt">;</span>

  <span class="function"><a href="gtk3-General.html#gtk-init">gtk_init</a></span> <span class="gtkdoc opt">(&amp;</span>argc<span class="gtkdoc opt">, &amp;</span>argv<span class="gtkdoc opt">);</span>

  win <span class="gtkdoc opt">=</span> <span class="function"><a href="GtkWindow.html#gtk-window-new">gtk_window_new</a></span> <span class="gtkdoc opt">(</span>GTK_WINDOW_TOPLEVEL<span class="gtkdoc opt">);</span>
  <span class="function"><a href="https://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span> <span class="gtkdoc opt">(</span>win<span class="gtkdoc opt">,</span>
                    <span class="string">&quot;delete-event&quot;</span><span class="gtkdoc opt">,</span>
                    <span class="function"><a href="https://developer.gnome.org/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span> <span class="gtkdoc opt">(</span>gtk_true<span class="gtkdoc opt">),</span>
                    NULL<span class="gtkdoc opt">);</span>
  <span class="function"><a href="https://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span> <span class="gtkdoc opt">(</span>win<span class="gtkdoc opt">,</span> <span class="string">&quot;destroy&quot;</span><span class="gtkdoc opt">,</span>
                    <span class="function"><a href="https://developer.gnome.org/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span> <span class="gtkdoc opt">(</span>gtk_main_quit<span class="gtkdoc opt">),</span>
                    NULL<span class="gtkdoc opt">);</span>

  but <span class="gtkdoc opt">=</span> <span class="function"><a href="GtkButton.html#gtk-button-new-with-label">gtk_button_new_with_label</a></span> <span class="gtkdoc opt">(</span>text<span class="gtkdoc opt">);</span>
  <span class="function"><a href="https://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect-swapped">g_signal_connect_swapped</a></span> <span class="gtkdoc opt">(</span>but<span class="gtkdoc opt">,</span> <span class="string">&quot;clicked&quot;</span><span class="gtkdoc opt">,</span>
                            <span class="function"><a href="https://developer.gnome.org/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span> <span class="gtkdoc opt">(</span>gtk_object_destroy<span class="gtkdoc opt">),</span>
                            win<span class="gtkdoc opt">);</span>
  <span class="function"><a href="GtkContainer.html#gtk-container-add">gtk_container_add</a></span> <span class="gtkdoc opt">(</span><span class="function">GTK_CONTAINER</span> <span class="gtkdoc opt">(</span>win<span class="gtkdoc opt">),</span> but<span class="gtkdoc opt">);</span>

  <span class="function"><a href="GtkWidget.html#gtk-widget-show-all">gtk_widget_show_all</a></span> <span class="gtkdoc opt">(</span>win<span class="gtkdoc opt">);</span>

  <span class="function"><a href="gtk3-General.html#gtk-main">gtk_main</a></span> <span class="gtkdoc opt">();</span>

  <span class="keyword">return</span> <span class="number">0</span><span class="gtkdoc opt">;</span>
<span class="gtkdoc opt">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
</div>
<div class="refsect3">
<a name="gtk-true.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-false"></a><h3>gtk_false ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_false (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Analogical to <a class="link" href="gtk3-General.html#gtk-true" title="gtk_true ()"><code class="function">gtk_true()</code></a>, this function does nothing
but always returns <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<div class="refsect3">
<a name="gtk-false.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-grab-add"></a><h3>gtk_grab_add ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_grab_add (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Makes <em class="parameter"><code>widget</code></em>
 the current grabbed widget.</p>
<p>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>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-grab-add.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>The widget that grabs keyboard and pointer events</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-grab-get-current"></a><h3>gtk_grab_get_current ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_grab_get_current (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Queries the current grab of the default window group.</p>
<div class="refsect3">
<a name="gtk-grab-get-current.returns"></a><h4>Returns</h4>
<p> The widget which currently
has the grab or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no grab is active. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-grab-remove"></a><h3>gtk_grab_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_grab_remove (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Removes the grab from the given widget.</p>
<p>You have to pair calls to <a class="link" href="gtk3-General.html#gtk-grab-add" title="gtk_grab_add ()"><code class="function">gtk_grab_add()</code></a> and <a class="link" href="gtk3-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>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-grab-remove.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>The widget which gives up the grab</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-device-grab-add"></a><h3>gtk_device_grab_add ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_device_grab_add (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
                     <em class="parameter"><code><a href="http://developer.gnome.org/gdk3/GdkDevice.html#GdkDevice-struct"><span class="type">GdkDevice</span></a> *device</code></em>,
                     <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> block_others</code></em>);</pre>
<p>Adds a GTK+ grab on <em class="parameter"><code>device</code></em>
, so all the events on <em class="parameter"><code>device</code></em>
 and its
associated pointer or keyboard (if any) are delivered to <em class="parameter"><code>widget</code></em>
.
If the <em class="parameter"><code>block_others</code></em>
 parameter is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, any other devices will be
unable to interact with <em class="parameter"><code>widget</code></em>
 during the grab.</p>
<div class="refsect3">
<a name="gtk-device-grab-add.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device</p></td>
<td class="parameter_description"><p>a <a href="http://developer.gnome.org/gdk3/GdkDevice.html#GdkDevice-struct"><span class="type">GdkDevice</span></a> to grab on.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>block_others</p></td>
<td class="parameter_description"><p><a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to prevent other devices to interact with <em class="parameter"><code>widget</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-device-grab-remove"></a><h3>gtk_device_grab_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_device_grab_remove (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
                        <em class="parameter"><code><a href="http://developer.gnome.org/gdk3/GdkDevice.html#GdkDevice-struct"><span class="type">GdkDevice</span></a> *device</code></em>);</pre>
<p>Removes a device grab from the given widget.</p>
<p>You have to pair calls to <a class="link" href="gtk3-General.html#gtk-device-grab-add" title="gtk_device_grab_add ()"><code class="function">gtk_device_grab_add()</code></a> and
<a class="link" href="gtk3-General.html#gtk-device-grab-remove" title="gtk_device_grab_remove ()"><code class="function">gtk_device_grab_remove()</code></a>.</p>
<div class="refsect3">
<a name="gtk-device-grab-remove.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device</p></td>
<td class="parameter_description"><p>a <a href="http://developer.gnome.org/gdk3/GdkDevice.html#GdkDevice-struct"><span class="type">GdkDevice</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-key-snooper-install"></a><h3>gtk_key_snooper_install ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gtk_key_snooper_install (<em class="parameter"><code><a class="link" href="gtk3-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a> snooper</code></em>,
                         <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_key_snooper_install</code> has been deprecated since version 3.4 and should not be used in newly-written code.</p>
<p>Key snooping should not be done. Events should
    be handled by widgets.</p>
</div>
<p>Installs a key snooper function, which will get called on all
key events before delivering them normally.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-key-snooper-install.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>snooper</p></td>
<td class="parameter_description"><p>a <a class="link" href="gtk3-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>func_data</p></td>
<td class="parameter_description"><p> data to pass to <em class="parameter"><code>snooper</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-key-snooper-install.returns"></a><h4>Returns</h4>
<p> a unique id for this key snooper for use with
<a class="link" href="gtk3-General.html#gtk-key-snooper-remove" title="gtk_key_snooper_remove ()"><code class="function">gtk_key_snooper_remove()</code></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GtkKeySnoopFunc"></a><h3>GtkKeySnoopFunc ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
<span class="c_punctuation">(</span>*GtkKeySnoopFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *grab_widget</code></em>,
                    <em class="parameter"><code><a href="http://developer.gnome.org/gdk3/gdk4-Event-Structures.html#GdkEventKey"><span class="type">GdkEventKey</span></a> *event</code></em>,
                    <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>);</pre>
<p>Key snooper functions are called before normal event delivery.
They can be used to implement custom key event handling.</p>
<div class="refsect3">
<a name="GtkKeySnoopFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>grab_widget</p></td>
<td class="parameter_description"><p>the widget to which the event will be delivered</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>the key event</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>func_data</p></td>
<td class="parameter_description"><p> data supplied to <a class="link" href="gtk3-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()"><code class="function">gtk_key_snooper_install()</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GtkKeySnoopFunc.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop further processing of <em class="parameter"><code>event</code></em>
, <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to continue.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-key-snooper-remove"></a><h3>gtk_key_snooper_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_key_snooper_remove (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> snooper_handler_id</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_key_snooper_remove</code> has been deprecated since version 3.4 and should not be used in newly-written code.</p>
<p>Key snooping should not be done. Events should
    be handled by widgets.</p>
</div>
<p>Removes the key snooper function with the given id.</p>
<div class="refsect3">
<a name="gtk-key-snooper-remove.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>snooper_handler_id</p></td>
<td class="parameter_description"><p>Identifies the key snooper to remove</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-current-event"></a><h3>gtk_get_current_event ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gdk3/gdk4-Event-Structures.html#GdkEvent"><span class="returnvalue">GdkEvent</span></a> *
gtk_get_current_event (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Obtains a copy of the event currently being processed by GTK+.</p>
<p>For example, if you are handling a <a class="link" href="GtkButton.html#GtkButton-clicked" title="The “clicked” signal"><span class="type">“clicked”</span></a> signal,
the current event will be the <a href="http://developer.gnome.org/gdk3/gdk4-Event-Structures.html#GdkEventButton"><span class="type">GdkEventButton</span></a> that triggered
the ::clicked signal.</p>
<div class="refsect3">
<a name="gtk-get-current-event.returns"></a><h4>Returns</h4>
<p> a copy of the current event, or
<a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no current event. The returned event must be
freed with <a href="http://developer.gnome.org/gdk3/gdk4-Events.html#gdk-event-free"><code class="function">gdk_event_free()</code></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-current-event-time"></a><h3>gtk_get_current_event_time ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>
gtk_get_current_event_time (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>If there is a current event and it has a timestamp,
return that timestamp, otherwise return <a href="http://developer.gnome.org/gdk3/gdk4-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>.</p>
<div class="refsect3">
<a name="gtk-get-current-event-time.returns"></a><h4>Returns</h4>
<p> the timestamp from the current event,
or <a href="http://developer.gnome.org/gdk3/gdk4-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-current-event-state"></a><h3>gtk_get_current_event_state ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_get_current_event_state (<em class="parameter"><code><a href="http://developer.gnome.org/gdk3/gdk4-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> *state</code></em>);</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="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, otherwise return
<a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<div class="refsect3">
<a name="gtk-get-current-event-state.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p> a location to store the state of the current event. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-get-current-event-state.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/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</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-current-event-device"></a><h3>gtk_get_current_event_device ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/gdk3/GdkDevice.html#GdkDevice-struct"><span class="returnvalue">GdkDevice</span></a> *
gtk_get_current_event_device (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>If there is a current event and it has a device, return that
device, otherwise return <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
<div class="refsect3">
<a name="gtk-get-current-event-device.returns"></a><h4>Returns</h4>
<p> a <a href="http://developer.gnome.org/gdk3/GdkDevice.html#GdkDevice-struct"><span class="type">GdkDevice</span></a>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-event-widget"></a><h3>gtk_get_event_widget ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_get_event_widget (<em class="parameter"><code><a href="http://developer.gnome.org/gdk3/gdk4-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre>
<p>If <em class="parameter"><code>event</code></em>
 is <a href="https://developer.gnome.org/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="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, otherwise returns the widget that received the event
originally.</p>
<div class="refsect3">
<a name="gtk-get-event-widget.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <a href="http://developer.gnome.org/gdk3/gdk4-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-get-event-widget.returns"></a><h4>Returns</h4>
<p> the widget that originally
received <em class="parameter"><code>event</code></em>
, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-propagate-event"></a><h3>gtk_propagate_event ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_propagate_event (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
                     <em class="parameter"><code><a href="http://developer.gnome.org/gdk3/gdk4-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre>
<p>Sends an event to a widget, propagating the event to parent widgets
if the event remains unhandled.</p>
<p>Events received by GTK+ from GDK normally begin in <a class="link" href="gtk3-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.</p>
<p>gtk_propagate_event() 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 <a class="link" href="GtkWidget.html#GtkWidget-event" title="The “event” signal"><span class="type">“event”</span></a> and possibly an
event-specific signal on a widget. <a class="link" href="gtk3-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="gtk3-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. There are almost
certainly better ways to achieve your goals. For example, use
<a href="http://developer.gnome.org/gdk3/gdk4-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>
<div class="refsect3">
<a name="gtk-propagate-event.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>an event</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="gtk3-General.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<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 functionality related to size allocation.</p>
<p>It is used internally by GTK+ to compute the sizes of widgets.
This priority is higher than <a href="http://developer.gnome.org/gdk3/gdk4-Events.html#GDK-PRIORITY-REDRAW:CAPS"><code class="literal">GDK_PRIORITY_REDRAW</code></a> to avoid
resizing a widget which was just redrawn.</p>
</div>
</div>
<div class="refsect1">
<a name="gtk3-General.see-also"></a><h2>See Also</h2>
<p>See the GLib manual, especially <a href="https://developer.gnome.org/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> and signal-related
   functions such as <a href="https://developer.gnome.org/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.25.1</div>
</body>
</html>