Re: what is the function name that you can send a function to be running every n milliseconds



y g wrote:

1. If function takes more that one argument how do I pass them in the
gpointer data...
eg.

gboolean
lala(gint a, gint b)
{
 return a+b;
}

The following fails, which by the way gives me a warning that the
second argument is of incompatible pointer type (do I need a cast?):
g_timeout_add(100, lala, a, b);

So the only way that I can think of if I want to pass more than one
argument is to make a structure that holds the two integers and pass
that one as an argument to the function.

That's exactly what you should do in this case: use a structure, since
all calbacks only supporte one user-supplied argument.

-- 
All this wheeling and dealing around, why, it isn't for money, it's for fun.
Money's just the way we keep score.
                -- Henry Tyroon

Eduardo M KALINOWSKI
ekalin bol com br
http://move.to/hpkb




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]