Deleting a timer
- From: "N poleone" <napoleone1981 gmail com>
- To: gtkmm-list gnome org
- Subject: Deleting a timer
- Date: Mon, 2 Jan 2006 15:36:47 +0100
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:
std::cout << "Inizialiting timer...\n";
guint timer_id;
timer_id = g_timeout_add(30000,(GSourceFunc)scansioneDB::acquisisciAux,true);
and
gboolean scansioneDB::acquisisciAux(bool start)
{
if (!start)
return 0;
else {
std::cout << "Eseguo operazione pianificata...\n";
return 1;
}
}
If, from the clicked event of the stop button, I call acquisisciAux
with false parameter this stop the timer??? Or i've to call
g_timeout_add(30000,(GSourceFunc)scansioneDB::acquisisciAux,false)???
--
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]