Re: gtk_timeout_add
- From: Owen Taylor <otaylor redhat com>
- To: "Ian Frawley" <ifrawley opaltelecom co uk>
- Cc: <gtk-app-devel-list gnome org>
- Subject: Re: gtk_timeout_add
- Date: 18 Jun 2001 10:45:04 -0400
"Ian Frawley" <ifrawley opaltelecom co uk> writes:
Right I have got it to compile with:
GtkWidget * Alarmlist = gtk_list_new;
gtk_timeout_add(10, GtkFunction ( GetAlarms ), Alarmlist);
When writing with GTK program, it would be normal to use a C style
cast here instead of a C++ one and write '(GtkFunction)GetAlarms'.
Of course, you might want to avoid the cast altogether and
let the compiler tell you that you got the prototype
for your callback wrong :-)
void GetAlarms(GtkWidget * button, gpointer data)
^^^^^^^^^^^^^^^^^^^
Where did this parameter come from? Why would a timeout
take a button button parameter?
Remove this parameter and add a gboolean return value
(TRUE = call again, FALSE = remove timeout), and
you won't need the cast, and things should work better.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]