The following patch for Xaw3d widget set introduces three additional resources for the Clock widget: hourOffset Int minuteOffset Int gmt Boolean hourOffset and minuteOffset are somewhat self explanatory. if gmt is set, gmtime() is used instead of localtime() to compute tm. if gmt is set to false (the default), the offsets are relative to localtime, otherwise relative to gmt. Below is a small wafe script showing the behaviour ================================================================ #! /usr/bin/X11/wafe --f mergeResources topLevel \ *background gray85 \ *borderWidth 0 \ *Clock.gmt true \ *Clock.update 1 \ *Clock.shadowWidth 3 form f topLevel clock NY f hourOffset -4 label NYlabel f fromVert NY label "New York" clock Vienna f fromHoriz NY hourOffset +2 label Vlabel f fromHoriz NY fromVert Vienna label "Vienna" realize ================================================================ -gustaf PS: here is the patch: ================================================================ *** Clock.c.orig Sun Apr 18 15:12:23 1993 --- Clock.c Sun Apr 18 16:04:59 1993 *************** *** 41,46 **** --- 41,47 ---- #ifdef X_NOT_STDC_ENV extern struct tm *localtime(); + extern struct tm *gmtime(); #endif static void clock_tic(), DrawHand(), DrawSecond(), SetSeg(), DrawClockFace(); *************** *** 95,100 **** --- 96,107 ---- offset(font), XtRString, XtDefaultFont}, {XtNbackingStore, XtCBackingStore, XtRBackingStore, sizeof (int), offset (backing_store), XtRString, "default"}, + {XtNhourOffset, XtChourOffset, XtRInt, sizeof(int), + offset(hourOffset), XtRImmediate, (XtPointer) 0}, + {XtNminuteOffset, XtCminuteOffset, XtRInt, sizeof(int), + offset(minuteOffset), XtRImmediate, (XtPointer) 0}, + {XtNgmTime, XtCgmTime, XtRBoolean, sizeof(Boolean), + offset(gmTime), XtRImmediate, (XtPointer) FALSE}, }; #undef offset *************** *** 188,194 **** struct tm tm; long time_value; (void) time(&time_value); ! tm = *localtime(&time_value); str = asctime(&tm); if (w->clock.font == NULL) w->clock.font = XQueryFont( XtDisplay(w), --- 195,204 ---- struct tm tm; long time_value; (void) time(&time_value); ! time_value += ! (long)w->clock.hourOffset*3600 + ! (long)w->clock.minuteOffset*60; ! tm = w->clock.gmTime ? *gmtime(&time_value) : *localtime(&time_value); str = asctime(&tm); if (w->clock.font == NULL) w->clock.font = XQueryFont( XtDisplay(w), *************** *** 329,335 **** XtAppAddTimeOut( XtWidgetToApplicationContext( (Widget) w), (unsigned long) w->clock.update*1000, clock_tic, (XtPointer)w ); (void) time(&time_value); ! tm = *localtime(&time_value); /* * Beep on the half hour; double-beep on the hour. */ --- 339,348 ---- XtAppAddTimeOut( XtWidgetToApplicationContext( (Widget) w), (unsigned long) w->clock.update*1000, clock_tic, (XtPointer)w ); (void) time(&time_value); ! time_value += ! (long)w->clock.hourOffset*3600 + ! (long)w->clock.minuteOffset*60; ! tm = w->clock.gmTime ? *gmtime(&time_value) : *localtime(&time_value); /* * Beep on the half hour; double-beep on the hour. */ *** Clock.h.orig Sun Apr 18 15:31:27 1993 --- Clock.h Sun Apr 18 16:15:04 1993 *************** *** 51,60 **** --- 51,63 ---- destroyCallback Callback Pointer NULL font Font XFontStruct* fixed foreground Foreground Pixel black + gmt Gmt Boolean False hand Foreground Pixel black height Height Dimension 164 highlight Foreground Pixel black + hourOffset HourOffset Int 0 mappedWhenManaged MappedWhenManaged Boolean True + minuteOffset MinuteOffset Int 0 padding Margin int 8 update Interval int 60 (seconds) width Width Dimension 164 *************** *** 77,82 **** --- 80,93 ---- /* Int: amount of space around outside of clock */ #define XtNpadding "padding" + + #define XtNhourOffset "hourOffset" + #define XtNminuteOffset "minuteOffset" + #define XtNgmTime "gmt" + + #define XtChourOffset "HourOffset" + #define XtCminuteOffset "MinuteOffset" + #define XtCgmTime "Gmt" typedef struct _ClockRec *ClockWidget; /* completely defined in ClockPrivate.h */ typedef struct _ClockClassRec *ClockWidgetClass; /* completely defined in ClockPrivate.h */ *** ClockP.h.orig Sun Apr 18 15:12:13 1993 --- ClockP.h Sun Apr 18 16:01:57 1993 *************** *** 56,61 **** --- 56,64 ---- Boolean beeped; Boolean analog; Boolean show_second_hand; + Boolean gmTime; + int hourOffset; + int minuteOffset; Dimension second_hand_length; Dimension minute_hand_length; Dimension hour_hand_length;