1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
>Timeouts, IO and Idle Functions</TITLE
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
TITLE="GTK+ 2.0 Tutorial"
11
HREF="book1.html"><LINK
13
TITLE="Setting Widget Attributes"
14
HREF="c1756.html"><LINK
17
HREF="x1772.html"></HEAD
28
SUMMARY="Header navigation table"
37
>GTK+ 2.0 Tutorial</TH
47
><<< Previous</A
61
>Next >>></A
74
>Timeouts, IO and Idle Functions</H1
84
>You may be wondering how you make GTK do useful work when in gtk_main.
85
Well, you have several options. Using the following function you can
86
create a timeout function that will be called every "interval"
95
CLASS="PROGRAMLISTING"
96
>gint g_timeout_add (guint32 interval,
103
>The first argument is the number of milliseconds between calls to your
104
function. The second argument is the function you wish to have called,
105
and the third, the data passed to this callback function. The return
106
value is an integer "tag" which may be used to stop the timeout by
115
CLASS="PROGRAMLISTING"
116
>void g_source_remove (gint tag);</PRE
121
>You may also stop the timeout function by returning zero or FALSE from
122
your callback function. Obviously this means if you want your function
123
to continue to be called, it should return a non-zero value,
126
>The declaration of your callback should look something like this:</P
134
CLASS="PROGRAMLISTING"
135
>gint timeout_callback (gpointer data);</PRE
146
SUMMARY="Footer navigation table"
159
><<< Previous</A
177
>Next >>></A
185
>Setting Widget Attributes</TD
b'\\ No newline at end of file'