Time Info Dialog Window
- From: John Kodis <kodis jagunet com>
- To: Jon Anhold <jon snoopy net>, John Ellis <johne bellatlantic net>, Beat Christen <spiff longstreet ch>, Patrick Rogan <rogan lycos com>, Miguel de Icaza <miguel kernel org>, Iņigo Serna <inigo bipv02 bi ehu es>, Federico Mena Quintero <federico redhat com>
- Cc: gnome-devel-list gnome org
- Subject: Time Info Dialog Window
- Date: Wed, 22 Sep 1999 07:57:51 -0400
I've written a custom dialog widget that displays detailed information
about the current (or any other) time of day. I think that this might
be something that a clock applet could usefully pop up in response to
a left mouse click.
Adding this to an existing applet involves merely connecting a
"clicked" signal to a simple callback function such as:
static void
timeinfo_dialog_popup(GtkWidget *button, GtkWidget *applet)
{
timeinfo_dialog(
_("It's about time"), /* Pop-up window title. */
GTK_WINDOW(applet), /* Optional transient_for window. */
NULL); /* A time_t value, or NULL for "now". */
}
This will generate a dialog window that looks something like:
+---------------------------------------------------+
| It's about time |
+---------------------------------------------------+
| Local: Wednesday, 1999 September 15 14:45:13 EDT |
| GMT: Wednesday, 1999 September 15 18:45:13 GMT |
| TZ: EDT (EST/EDT); 5:00 West of GMT |
| DST: is currently in effect |
| Day: 258 of 365 in 1999, a non-leap year |
| Week: 37 of 52 in 1999 (ISO 8601) |
| Julian: 2451437.28140 |
| Moon: is waxing gibbous in lunation 949 |
+---------------------------------------------------+
| Okay |
+---------------------------------------------------+
I plan on adding code to display the time of sunrise and sunset,
moonrise and moonset, and perhaps the time of the next high and low
tides, and whatever other information I find interesting and that I
can find suitable algorithms for.
You can get a better idea of what this looks like at the web page:
http://www.jagunet.com/~kodis/timeinfo/
and can snag the distribution kit, which includes the sources for the
timeinfo library, a simple clock applet that pops up this dialog, and
a command-line timeinfo program, from:
ftp://ftp.jagunet.com/pub/users/kodis/timeinfo-0.2.tar.gz
Thanks for your time, and happy clockmaking.
-- John Kodis.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]