1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
>Signal Emission and Propagation</TITLE
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
TITLE="GTK+ 2.0 Tutorial"
11
HREF="book1.html"><LINK
13
TITLE="Advanced Event and Signal Handling"
14
HREF="c1799.html"><LINK
16
TITLE="Advanced Event and Signal Handling"
17
HREF="c1799.html"><LINK
19
TITLE="Managing Selections"
20
HREF="c1836.html"></HEAD
31
SUMMARY="Header navigation table"
40
>GTK+ 2.0 Tutorial</TH
50
><<< Previous</A
56
>Advanced Event and Signal Handling</TD
64
>Next >>></A
76
NAME="SEC-SIGNALEMISSIONANDPROPAGATION"
77
>Signal Emission and Propagation</A
80
>Signal emission is the process whereby GTK runs all handlers for a
81
specific object and signal.</P
83
>First, note that the return value from a signal emission is the return
87
> handler executed. Since event signals are
91
>, this will be the default (GTK supplied)
92
handler, unless you connect with gtk_signal_connect_after().</P
94
>The way an event (say "button_press_event") is handled, is:</P
100
>Start with the widget where the event occured.</P
104
>Emit the generic "event" signal. If that signal handler returns
105
a value of TRUE, stop all processing.</P
109
>Otherwise, emit a specific, "button_press_event" signal. If that
110
returns TRUE, stop all processing.</P
114
>Otherwise, go to the widget's parent, and repeat the above two
119
>Continue until some signal handler returns TRUE, or until the
120
top-level widget is reached.</P
124
>Some consequences of the above are:</P
130
>Your handler's return value will have no effect if there is a
131
default handler, unless you connect with gtk_signal_connect_after().</P
135
>To prevent the default handler from being run, you need to
136
connect with gtk_signal_connect() and use
137
gtk_signal_emit_stop_by_name() - the return value only affects whether
138
the signal is propagated, not the current emission.</P
147
SUMMARY="Footer navigation table"
160
><<< Previous</A
178
>Next >>></A
186
>Advanced Event and Signal Handling</TD
200
>Managing Selections</TD
b'\\ No newline at end of file'