Re: Deleting a timer



On 1/2/06, Chris Vine <chris cvine freeserve co uk> wrote:
> On Monday 02 January 2006 14:36, N poleone wrote:
> > Hi,
> > I used g_timeout_add to call a function every tot seconds (or minutes).
> > Now I'd want to delete and add dynamically the timer. In other words,
> > i've a button that initialize the timer, and another button that stop
> > the timer. So if i click the first button:
> > [CUT]
>
> You are on the wrong list,

What is the right list, so I can post there?

>but in any event, the timer is removed if either:
>
> 1. g_source_remove() is called on the timer id returned by g_timeout_add, or
> 2. the callback returns false.
>
> Passing a boolean value to the third argument of g_timeout_add() should fail
> to compile (the third argument is a void* and not an int), and it is also
> pointless since the assigned value will be passed to every invocation of the
> callback, not just the first one.  (You could pass an unsigned integer value
> with the GUINT_TO_POINTER() macro and then cast it back in the callback with
> the GPOINTER_TO_UINT() macro, but it would remain pointless.)
>
> Chris
>
>

So, I've to understand better the timer... Anyway a last question:
My actual goal is to call a function at an interval, but with
different parameters every interval. Specifically, the parameters are
the time of the last call to the function (or a specfied time) and the
current time (or a specified time). Is it possible with
g_timeout_add??


--
Ciao da
N poleone (ICQ# 266220356; MSN Messenger: napoleone1981 yahoo it)
"Le battaglie si vincono con gli uomini che si hanno, non con quelli che
si vorrebbero" (Napoleone Bonaparte)
"Le cose che possiedi prima o poi ti possiedono..." (Fight Club)
"Le donne possono avere bambini...gli uomini computers" (Anonimo)



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