Re: time
- From: kilobug freesurf fr (Gaël Le Mignot)
- To: christophe Meyer <chr meyer nerim net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: time
- Date: Tue, 20 Jan 2004 10:01:26 +0100
Hello christophe!
Tue, 20 Jan 2004 09:37:27 +0100, you wrote:
Hi,
Hello
How can i do to display the current time dynamically in a status bar ?
I know how to display the time in the the status bar but not how to
increment the seconds (minutes, hours) and then to display them
each second.
So how can i update the status bar each second ?
Use a g_timeout, with http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html#g-timeout-add
Your callback function will be called every second (or whatever you
ask for) until it returns FALSE. You can then update the statusbar
from this function. However, this will only work while the mainloop is
running, and will not 'preempt' any long running function. In most
graphical app, when the mainloop is running most of the time, this
should not be a problem. If you do a long computation or blocking IO
on a slow device (network socket, ...), the time may stop - but well,
if you don't run he mainloop, your widgets will not be refreshed
anyway.
--
Gael Le Mignot "Kilobug" - kilobug nerim net - http://kilobug.free.fr
GSM : 06.71.47.18.22 (in France) ICQ UIN : 7299959
Fingerprint : 1F2C 9804 7505 79DF 95E6 7323 B66B F67B 7103 C5DA
Member of HurdFr: http://hurdfr.org - The GNU Hurd: http://hurd.gnu.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]