Re: gtk_timeout_add



I have removed that parameter and added a gboolean return value. Now when I
compile it I get:

undefined reference to GetAlarms(void *)

----- Original Message -----
From: "Owen Taylor" <otaylor redhat com>
To: "Ian Frawley" <ifrawley opaltelecom co uk>
Cc: <gtk-app-devel-list gnome org>
Sent: Monday, June 18, 2001 3:45 PM
Subject: Re: gtk_timeout_add



"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]