Time Info Dialog Window

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)
            _("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:


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:


Thanks for your time, and happy clockmaking.

-- John Kodis.

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