--- clock.c	Sat Jun  2 12:06:21 2001
+++ clock-new.c	Tue Jun 19 10:36:16 2001
@@ -7,11 +7,13 @@
  *          Stuart Parmenter
  *
  * Feel free to implement new look and feels :-)
+ * I tried: Mike Capell
  */
 
-#include "config.h"
+
 
 #include <stdio.h>
+#include <config.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <dirent.h>
@@ -24,15 +26,6 @@
 
 #include "clock.h"
 
-#define INTERNETSECOND (864/4)
-
-/* values for selection info */
-enum {
-  TARGET_STRING,
-  TARGET_TEXT,
-  TARGET_COMPOUND_TEXT,
-};
-
 typedef struct _ClockData ClockData;
 typedef void (*ClockUpdateFunc) (ClockData *, time_t);
 struct _ClockData {
@@ -43,23 +36,32 @@
 	int hourformat;
         gboolean showdate;
 	gboolean unixtime;
-	gboolean internettime;
 	gboolean gmt_time;
 	gboolean showtooltip;
 	ClockUpdateFunc update_func;
 	PanelOrientType orient;
 	int size;
-	char *copied_string;
+        gboolean use_custom_fmt;
+        char *custom_fmt;
+        gboolean use_custom_font;
+        char *custom_font;
 
 	GtkWidget *props;
 	int prop_hourformat;
-        gboolean prop_showdate;
-	gboolean prop_unixtime;
-	gboolean prop_internettime;
-	gboolean prop_gmt_time;
-	gboolean prop_showtooltip;
+        int prop_showdate;
+	int prop_unixtime;
+	int prop_gmt_time;
+	int prop_showtooltip;
+        int prop_use_custom_fmt;
+        char *prop_custom_fmt;
+        int prop_use_custom_font;
+        char *prop_custom_font;
+        GtkWidget *font_entry;
 };
 
+#define DEFAULT_CUSTOM_FMT "%a %d %b%n%H:%M"
+#define DEFAULT_CUSTOM_FONT "-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1"
+
 typedef struct {
 	GtkWidget *time; /*the time label*/
 	GtkWidget *align; /* Needed for changing the padding */
@@ -68,7 +70,7 @@
 
 static void clock_properties (AppletWidget *applet, gpointer data);
 static void clock_about      (AppletWidget *applet, gpointer data);
-static void help_cb	     (AppletWidget *w, gpointer data);
+static void help_cb	     (GtkWidget *w, gpointer data);
 static void phelp_cb	     (GtkWidget *w, gint tab, gpointer data);
 
 static void
@@ -86,7 +88,6 @@
 	time(&current_time);
 
 	(*cd->update_func) (cd, current_time);
-
 	if(cd->unixtime) {
 		if (cd->timeouttime != 1000) {
 			cd->timeouttime = 1000;
@@ -95,14 +96,6 @@
 						      cd);
 			return FALSE;
 		}
-	} else if(cd->internettime) {
-		if (cd->timeouttime != INTERNETSECOND) {
-			cd->timeouttime = INTERNETSECOND;
-			cd->timeout = gtk_timeout_add(cd->timeouttime,
-						      clock_timeout_callback,
-						      cd);
-			return FALSE;
-		}	   
 	} else {
 		if (cd->timeouttime != 36000) {
 			cd->timeouttime = 36000;
@@ -127,9 +120,14 @@
 	gnome_config_set_int("clock/hourformat", cd->hourformat);
 	gnome_config_set_int("clock/showdate", cd->showdate);
 	gnome_config_set_int("clock/unixtime", cd->unixtime);
-	gnome_config_set_int("clock/internettime", cd->internettime);
 	gnome_config_set_int("clock/showtooltip", cd->showtooltip);
 	gnome_config_set_int("clock/gmt_time", cd->gmt_time);
+	gnome_config_set_int("clock/use_custom_fmt", cd->use_custom_fmt);
+	gnome_config_set_string("clock/custom_fmt", cd->custom_fmt ? 
+                                 cd->custom_fmt : DEFAULT_CUSTOM_FMT );
+	gnome_config_set_int("clock/use_custom_font", cd->use_custom_font);
+	gnome_config_set_string("clock/custom_font", cd->custom_font ? 
+                                 cd->custom_font : DEFAULT_CUSTOM_FONT );
 	gnome_config_pop_prefix();
 	gnome_config_sync();
 	gnome_config_drop_all();
@@ -137,27 +135,13 @@
 	return FALSE;
 }
 
-static float
-get_itime (time_t current_time)
-{
-	struct tm *tm;
-	float itime;
-	time_t bmt;
-
-	bmt = current_time + 3600;
-	tm = gmtime(&bmt);
-	itime = (tm->tm_hour*60+tm->tm_min+tm->tm_sec/60.0)*1000.0/1440.0;
-
-	return itime;
-}
-
 static void
 computer_clock_update_func(ClockData * cd, time_t current_time)
 {
 	ComputerClock *cc;
 	struct tm *tm;
 	GString *gs = g_string_new("");
-	char date[256], hour[256], tooltip[256];
+	char date[20], hour[20], tooltip[30];
 
 	cc = gtk_object_get_user_data(GTK_OBJECT(cd->clockw));
 
@@ -169,66 +153,83 @@
 	if (cd->unixtime) {
 		if ((cd->orient == ORIENT_LEFT || cd->orient == ORIENT_RIGHT) &&
 		    cd->size >= PIXEL_SIZE_STANDARD) {
-			g_snprintf(hour,sizeof(hour),"%lu\n%05lu",
+			g_snprintf(hour,20,"%lu\n%lu",
 				   (unsigned long)(current_time/100000L),
 				   (unsigned long)(current_time%100000L));
 		} else {
-			g_snprintf(hour,sizeof(hour),"%lu",(unsigned long)current_time);
+			g_snprintf(hour,20,"%lu",(unsigned long)current_time);
 		} 
 		g_string_append(gs,hour);
-	} else if (cd->internettime) {
-		float itime = get_itime (current_time);
-		g_snprintf(hour,sizeof(hour),"@%3.2f",itime);
-		g_string_append(gs,hour);
-	} else if (cd->hourformat == 12) {
-		/* This format string is used, to display the actual time in
-		   12 hour format.  */
-		if ((cd->orient == ORIENT_LEFT || cd->orient == ORIENT_RIGHT) &&
-		    cd->size >= PIXEL_SIZE_STANDARD) {
-			if (strftime(hour, sizeof (hour), _("%I:%M\n%p"), tm) <= 0)
-				strcpy (hour, "???");
-		} else {
-			if (strftime(hour, sizeof (hour), _("%I:%M %p"), tm) <= 0)
-				strcpy (hour, "???");
-		} 
-		g_string_append(gs,hour);
-	} else if (cd->hourformat == 24) {
-		/* This format string is used, to display the actual time in
-		   24 hour format.  */
-		if (strftime(hour, sizeof (hour), _("%H:%M"), tm) <= 0)
-			strcpy (hour, "???");
-		g_string_append(gs,hour);
+	} else {
+	        if (cd->use_custom_fmt) {
+		        char s[128];
+			char l = sizeof(s);
+                        if(cd->custom_fmt){
+			        if (strftime(s, l, cd->custom_fmt,tm) == l)
+                                        s[l-1] = '\0';
+		                g_string_append(gs, s);
+			} else 
+		                g_string_append(gs, "Ouch");
+	        } else {
+                        if (cd->hourformat == 0) {
+		                /* This format string is used, to display 
+                                   the actual time in 12 hour format.  */
+		                if ( (cd->orient == ORIENT_LEFT || 
+                                      cd->orient == ORIENT_RIGHT) &&
+		                    cd->size >= PIXEL_SIZE_STANDARD) {
+			                if (strftime(hour, 20, _("%I:%M\n%p"),
+                                                     tm) == 20)
+                                                hour[19] = '\0';
+                         	} else {
+			                if (strftime(hour, 20, _("%I:%M %p"),
+                                                     tm) == 20)
+                                                hour[19] = '\0';
+                                }
+		                g_string_append(gs,hour);
+	                } else if (cd->hourformat == 1) {
+		                /* This format string is used, to display 
+                                   the actual time in 24 hour format.  */
+		                if (strftime(hour, 20, _("%H:%M"), tm) == 20)
+			                hour[19] = '\0';
+		                g_string_append(gs,hour);
+	                } else {
+		                g_string_append(gs,"Oops");
+                        }
+                	if (cd->showdate) {
+		                if ((cd->orient == ORIENT_LEFT || 
+                                     cd->orient == ORIENT_RIGHT) &&
+		                     cd->size   >= PIXEL_SIZE_STANDARD) {
+			                /* This format string is used, to 
+                                           display the actual day, when 
+                                           showing a vertical panel.  For an 
+                                           explanation of this format string 
+                                           type 'man strftime'.  */
+			                if (strftime(date, 20, _("%a\n%b %d"), 
+                                                     tm) == 20) date[19] = '\0';
+		                } else {
+			                /* This format string is used, to 
+                                           display the actual day,
+			                   when showing a horizontal panel.  */
+			                if (strftime(date, 20, _("%a %b %d"), 
+                                                     tm) == 20) date[19] = '\0';
+		                }
+		                if(cd->size < PIXEL_SIZE_STANDARD)
+			                g_string_append_c(gs,' ');
+		                else
+			                g_string_append_c(gs,'\n');
+		                g_string_append(gs,date);
+	                }
+	        }
+	        /* Set the applets tooltip */
+	        if (cd->showtooltip) {
+		        if (strftime(tooltip, 30, _("%A, %B %d"), tm) == 30)
+			        date[29] = '\0';
+		        applet_widget_set_tooltip(APPLET_WIDGET(cd->applet), 
+                                                  tooltip);
+	        }
 	}
 
-	if (cd->showdate && !cd->unixtime && !cd->internettime) {
-		if ((cd->orient == ORIENT_LEFT || cd->orient == ORIENT_RIGHT) &&
-		    cd->size >= PIXEL_SIZE_STANDARD) {
-			/* This format string is used, to display the actual day,
-			   when showing a vertical panel.  For an explanation of
-			   this format string type 'man strftime'.  */
-			if (strftime(date, sizeof (date), _("%a\n%b %d"), tm) <= 0)
-				strcpy (date, "???");
-		} else {
-			/* This format string is used, to display the actual day,
-			   when showing a horizontal panel.  */
-			if (strftime(date, sizeof (date), _("%a %b %d"), tm) <= 0)
-				strcpy (date, "???");
-		}
-		if(cd->size < PIXEL_SIZE_STANDARD)
-			g_string_append_c(gs,' ');
-		else
-			g_string_append_c(gs,'\n');
-		g_string_append(gs,date);
-	}
-	
-	/* Set the applets tooltip */
-	if (cd->showtooltip && !cd->unixtime && !cd->internettime) {
-		if (strftime(tooltip, sizeof (tooltip), _("%A, %B %d"), tm) <= 0)
-			strcpy (tooltip, "???");
-		applet_widget_set_tooltip(APPLET_WIDGET(cd->applet), tooltip);
-	}
-	
-	/*if we are vertical, just make it char per line*/
+	/*if we are vertical and narrow, just make it char per line*/
 	if ((cd->orient == ORIENT_LEFT || cd->orient == ORIENT_RIGHT) &&
 	    cd->size < PIXEL_SIZE_STANDARD) {
 		char *p;
@@ -254,10 +255,10 @@
 	ComputerClock *cc;
 
 	frame = gtk_frame_new(NULL);
-	gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE);
+	gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
 	gtk_widget_show(frame);
 
-	cc = g_new0 (ComputerClock, 1);
+	cc = g_new(ComputerClock, 1);
 
 	cc->align = gtk_alignment_new(0.5, 0.5, 0.0, 0.0);
 	gtk_container_set_border_width(GTK_CONTAINER(cc->align), 3);
@@ -286,15 +287,9 @@
 destroy_clock(GtkWidget * widget, gpointer data)
 {
 	ClockData *cd = data;
-
-	if (cd->timeout > 0)
-		gtk_timeout_remove (cd->timeout);
-	cd->timeout = 0;
-
+	gtk_timeout_remove(cd->timeout);
 	if(cd->props)
 		gtk_widget_destroy(cd->props);
-	cd->props = NULL;
-
 	g_free(cd);
 }
 
@@ -331,8 +326,6 @@
     
 	if(cd->unixtime)
 		cd->timeouttime = 1000;
-        else if(cd->internettime)
-                cd->timeouttime = INTERNETSECOND;
 	else
 		cd->timeouttime = 36000-(tm->tm_sec*600);
 	cd->timeout = gtk_timeout_add(cd->timeouttime,
@@ -353,6 +346,7 @@
 	cd->orient = o;
 	(*cd->update_func) (cd, current_time);
 }
+
 /*this is when the panel size changes */
 static void
 applet_change_pixel_size(GtkWidget * w, int size, gpointer data)
@@ -371,119 +365,29 @@
 }
 
 static void
-copy_time (AppletWidget *applet, gpointer data)
-{
-	ClockData *cd = data;
-	time_t current_time = time (NULL);
-	struct tm *tm;
-	char string[256];
-
-	if (cd->gmt_time)
-		tm = gmtime(&current_time);
-	else
-		tm = localtime(&current_time);
-
-	if (cd->unixtime) {
-		g_snprintf (string, sizeof(string), "%lu",
-			    (unsigned long)current_time);
-	} else if (cd->internettime) {
-		float itime = get_itime (current_time);
-		g_snprintf (string, sizeof (string), "@%3.2f", itime);
-	} else if (cd->hourformat == 12) {
-		/* This format string is used, to display the actual time in
-		   12 hour format.  */
-		if (strftime(string, sizeof (string), _("%I:%M %p"), tm) <= 0)
-			strcpy (string, "???");
-	} else if (cd->hourformat == 24) {
-		/* This format string is used, to display the actual time in
-		   24 hour format.  */
-		if (strftime(string, sizeof (string), _("%H:%M"), tm) <= 0)
-			strcpy (string, "???");
-	}
-
-	g_free (cd->copied_string);
-	cd->copied_string = g_strdup (string);
-
-	gtk_selection_owner_set (GTK_WIDGET (applet),
-				 gdk_atom_intern ("CLIPBOARD", FALSE),
-				 GDK_CURRENT_TIME);
-}
-
-static void
-copy_date (AppletWidget *applet, gpointer data)
-{
-	ClockData *cd = data;
-	time_t current_time = time (NULL);
-	struct tm *tm;
-	char string[256];
-
-	if (cd->gmt_time)
-		tm = gmtime(&current_time);
-	else
-		tm = localtime(&current_time);
-
-	if (strftime(string, sizeof (string), _("%A, %B %d %Y"), tm) <= 0)
-		strcpy (string, "???");
-	
-	g_free (cd->copied_string);
-	cd->copied_string = g_strdup (string);
-
-	gtk_selection_owner_set (GTK_WIDGET (applet),
-                                 gdk_atom_intern ("CLIPBOARD", FALSE),
-				 GDK_CURRENT_TIME);
-}
-
-/* current timestamp */
-static void
-copy_timestamp (AppletWidget *applet, gpointer data)
+apply_properties_font(gpointer data)
 {
 	ClockData *cd = data;
-	time_t current_time = time (NULL);
-	struct tm *tm;
-	char string[256];
-
-	tm = localtime(&current_time);
-
-	if (strftime(string, sizeof (string),
-		     /* RFC822 conformant date, likely not different for other
-		      * locales I don't think */
-		     _("%a, %d  %b  %Y %H:%M:%S %z"), tm) <= 0)
-		strcpy (string, "???");
-	
-	g_free (cd->copied_string);
-	cd->copied_string = g_strdup (string);
-
-	gtk_selection_owner_set (GTK_WIDGET (applet),
-                                 gdk_atom_intern ("CLIPBOARD", FALSE),
-				 GDK_CURRENT_TIME);
-}
+	ComputerClock *cc;
+	GtkStyle *style;
+	GdkFont  *font;
 
-static void
-selection_handle (GtkWidget *widget, 
-		  GtkSelectionData *selection_data,
-		  int info, int time,
-		  gpointer data)
-{
-	ClockData *cd = data;
+	cc = gtk_object_get_user_data(GTK_OBJECT(cd->clockw));
 
-	if (info == TARGET_STRING) {
-		gtk_selection_data_set (selection_data,
-					GDK_SELECTION_TYPE_STRING,
-					8 * sizeof(gchar),
-					(guchar *)cd->copied_string,
-					strlen (cd->copied_string));
-	} else if ((info == TARGET_TEXT) || (info == TARGET_COMPOUND_TEXT)) {
-		guchar *text;
-		GdkAtom encoding;
-		gint format;
-		gint new_length;
-
-		gdk_string_to_compound_text (cd->copied_string,
-					     &encoding, &format,
-					     &text, &new_length);
-		gtk_selection_data_set (selection_data, encoding, format,
-					text, new_length);
-		gdk_free_compound_text (text);
+	if (cd->use_custom_font && cd->custom_font) {
+	       /*
+                * hacked from gtk tutorial
+                * FIXME: things should be freed ?
+	        */
+                font = gdk_font_load( cd->custom_font);
+	        style = gtk_style_copy(gtk_widget_get_style(cc->time));
+		gdk_font_unref(style->font);
+		style->font = font;
+                gdk_font_ref(style->font);
+                gtk_widget_set_style( cc->time, style);
+        } else {
+                style = gtk_widget_get_style( cc->time->parent);
+                gtk_widget_set_rc_style( cc->time);
 	}
 }
 
@@ -492,12 +396,6 @@
 {
 	ClockData *cd;
 	GtkWidget *applet;
-	GtkTargetEntry targets[] = {
-		{ "STRING", TARGET_STRING },
-		{ "TEXT",   TARGET_TEXT }, 
-		{ "COMPOUND_TEXT", TARGET_COMPOUND_TEXT }
-	};
-	gint n_targets = sizeof(targets) / sizeof(targets[0]);
 
 	applet = applet_widget_new(goad_id);
 	if (!applet) {
@@ -505,39 +403,10 @@
 		return NULL;
 	}
 
-	cd = g_new0 (ClockData, 1);
-
-	cd->copied_string = NULL;
+	cd = g_new(ClockData, 1);
 
 	gnome_config_push_prefix(APPLET_WIDGET(applet)->privcfgpath);
-
-	/* A kluge to allow translation of default hour format to 12 or
-	 * 24 hour format */
-	{
-		/* Do NOT translate the clock/hourformat part.  What you
-		 * should change is the 12.  If your country code should use
-		 * 12 hour format by default, leave it at 12, otherwise use 24
-		 * for 24 hour format.  Those are the only two supported */
-		char *transl = _("clock/hourformat=12");
-		/* sanity */
-		if (strncmp (transl, "clock/hourformat=",
-			     strlen ("clock/hourformat=") != 0)) {
-			g_warning("Clock applet string clock/hourformat=12 "
-				  "was not translated correctly in this locale.");
-			transl = "clock/hourformat=12";
-		}
-		cd->hourformat = gnome_config_get_int(transl);
-
-		/* support the old syntax */
-		if (cd->hourformat == 0)
-			cd->hourformat = 12;
-		else if (cd->hourformat == 1)
-			cd->hourformat = 24;
-
-		/* make sure it's a sane value, we use 24 otherwise */
-		if (cd->hourformat != 12 && cd->hourformat != 24)
-			cd->hourformat = 24;
-	}
+	cd->hourformat = gnome_config_get_int("clock/hourformat=0");
 	/* if on a small screen don't show data by default */
 	if(gdk_screen_width()<=800)
 		cd->showdate = gnome_config_get_int("clock/showdate=0");
@@ -545,17 +414,24 @@
 		cd->showdate = gnome_config_get_int("clock/showdate=1");
 
 	cd->unixtime = gnome_config_get_int("clock/unixtime=0");
-	cd->internettime = gnome_config_get_int("clock/internettime=0");
 	/* if on a small screen show tooltip with date by default */
 	if(gdk_screen_width()<=800)
 		cd->showtooltip = gnome_config_get_int("clock/showtooltip=1");
 	else
 		cd->showtooltip = gnome_config_get_int("clock/showtooltip=0");
 	cd->gmt_time = gnome_config_get_int("clock/gmt_time=0");
+	cd->use_custom_fmt = gnome_config_get_int("clock/use_custom_fmt=0");
+	cd->custom_fmt = gnome_config_get_string(
+                           "clock/custom_fmt=" DEFAULT_CUSTOM_FMT);
+	cd->use_custom_font = gnome_config_get_int("clock/use_custom_font=0");
+	cd->custom_font = gnome_config_get_string(
+                           "clock/custom_font=" DEFAULT_CUSTOM_FONT);
 	gnome_config_pop_prefix();
 
 	create_clock_widget(cd, applet);
 
+	apply_properties_font(cd);
+
 	/*we have to bind change_orient before we do applet_widget_add 
 	  since we need to get an initial change_orient signal to set our
 	  initial oriantation, and we get that during the _add call */
@@ -583,20 +459,6 @@
 					      clock_properties,
 					      cd);
 
-	applet_widget_register_stock_callback (APPLET_WIDGET (applet),
-					       "copy_time",
-					       GNOME_STOCK_MENU_COPY,
-					       _("Copy time"),
-					       copy_time,
-					       cd);
-
-	applet_widget_register_stock_callback (APPLET_WIDGET (applet),
-					       "copy_date",
-					       GNOME_STOCK_MENU_COPY,
-					       _("Copy date"),
-					       copy_date,
-					       cd);
-
 	applet_widget_register_stock_callback(APPLET_WIDGET(applet),
 					      "help",
 					      GNOME_STOCK_PIXMAP_HELP,
@@ -610,14 +472,6 @@
 					      _("About..."),
 					      clock_about,
 					      NULL);
-
-	gtk_selection_add_targets (GTK_WIDGET (applet),
-                                   gdk_atom_intern ("CLIPBOARD", FALSE),
-				   targets, n_targets);
-
-        gtk_signal_connect (GTK_OBJECT (applet), "selection_get",
-			    GTK_SIGNAL_FUNC (selection_handle), cd);
-
 	return applet;
 }
 
@@ -628,13 +482,19 @@
 	time_t current_time;
 	struct tm *tm;
 
-	cd->hourformat = cd->prop_hourformat;
-	cd->showdate = cd->prop_showdate;
-	cd->unixtime = cd->prop_unixtime;
-   	cd->internettime = cd->prop_internettime;
-	cd->gmt_time = cd->prop_gmt_time;
+	cd->hourformat  = cd->prop_hourformat;
+	cd->showdate    = cd->prop_showdate;
+	cd->unixtime    = cd->prop_unixtime;
+	cd->gmt_time    = cd->prop_gmt_time;
 	cd->showtooltip = cd->prop_showtooltip;
+	cd->use_custom_fmt = cd->prop_use_custom_fmt;
+	cd->custom_fmt  = cd->prop_custom_fmt;
+	cd->use_custom_font = cd->prop_use_custom_font;
+	cd->custom_font  = cd->prop_custom_font;
+
+	apply_properties_font(data);
 
+	applet_widget_queue_resize(APPLET_WIDGET(cd->applet));
 	/* Call the clock's update function so that it paints its first state */
 	time(&current_time);
 	(*cd->update_func) (cd, current_time);
@@ -647,16 +507,14 @@
 	else
 		tm = localtime(&current_time);
 
-	if(cd->unixtime)
+	if (cd->unixtime)
 		cd->timeouttime = 1000;
-        else if(cd->internettime)
-                cd->timeouttime = INTERNETSECOND;
 	else
 		cd->timeouttime = 36000-(tm->tm_sec*600);
 	cd->timeout = gtk_timeout_add(cd->timeouttime,
 				      clock_timeout_callback,
 				      cd);		      
-	if(!cd->showtooltip || cd->unixtime || cd->internettime)
+	if(!cd->showtooltip || cd->unixtime)
   		applet_widget_set_tooltip(APPLET_WIDGET(cd->applet), "");
 				      
 /* gtk_widget_queue_resize (cd->clockw);*/
@@ -676,7 +534,7 @@
 	g_return_if_fail(w != NULL);
 	if(GTK_TOGGLE_BUTTON(w)->active) {
 		ClockData *cd = gtk_object_get_user_data(GTK_OBJECT(w));
-		cd->prop_hourformat = GPOINTER_TO_INT(data);
+		cd->prop_hourformat = (long)data;
 		gnome_property_box_changed (GNOME_PROPERTY_BOX (cd->props));
 	}
 }
@@ -697,12 +555,9 @@
 }
 
 static void
-set_internettime_cb(GtkWidget * w, gpointer data)
+set_datainsensitive_cb(GtkWidget * w, GtkWidget *wid)
 {
-	ClockData *cd = data;
-
-	cd->prop_internettime = GTK_TOGGLE_BUTTON(w)->active;
-	gnome_property_box_changed (GNOME_PROPERTY_BOX (cd->props));
+	gtk_widget_set_sensitive(wid, (GTK_TOGGLE_BUTTON(w)->active));
 }
 
 static void
@@ -733,53 +588,163 @@
 }
 
 static void
+set_custom_fmt_cb(GtkWidget * w, gpointer data)
+{
+	g_return_if_fail(w != NULL);
+	if(GTK_TOGGLE_BUTTON(w)->active) {
+		ClockData *cd = gtk_object_get_user_data(GTK_OBJECT(w));
+		cd->prop_use_custom_fmt = (long)data;
+		gnome_property_box_changed (GNOME_PROPERTY_BOX (cd->props));
+	}
+}
+
+static void
+changed_custom_fmt_cb(GtkWidget * w, gpointer data)
+{
+	ClockData *cd = data;
+
+	if(cd->prop_custom_fmt) 
+                g_free(cd->prop_custom_fmt);
+
+	cd->prop_custom_fmt = g_strdup(gtk_entry_get_text (GTK_ENTRY (w)));
+	gnome_property_box_changed (GNOME_PROPERTY_BOX (cd->props));
+}
+
+static void
+set_custom_font_cb(GtkWidget * w, gpointer data)
+{
+	ClockData *cd = data;
+
+	cd->prop_use_custom_font = GTK_TOGGLE_BUTTON(w)->active;
+	gnome_property_box_changed (GNOME_PROPERTY_BOX (cd->props));
+}
+
+static void
+changed_custom_font_cb(GtkWidget * w, gpointer data)
+{
+	ClockData *cd = data;
+
+	char *font;
+	GtkWidget *peer;
+	if (GNOME_IS_FONT_PICKER(w)){
+		font = gnome_font_picker_get_font_name (GNOME_FONT_PICKER(w));
+		peer = gtk_object_get_user_data (GTK_OBJECT(w));
+		gtk_entry_set_text (GTK_ENTRY(peer), font);
+	} else {
+		font = gtk_entry_get_text (GTK_ENTRY(w));
+		peer = gtk_object_get_user_data (GTK_OBJECT(w));
+		gnome_font_picker_set_font_name (GNOME_FONT_PICKER(peer), font);
+	        if(cd->prop_custom_font) 
+                        g_free(cd->prop_custom_font);
+        	cd->prop_custom_font = g_strdup(font);
+	        gnome_property_box_changed (GNOME_PROPERTY_BOX (cd->props));
+	}
+}
+
+/*
+ * my understanding of what should be decided/displayed:
+ *                     DEFAULT
+ * show unix time ?      NO    (if YES nothing else matters)
+ * else
+ *   use GMT ?           NO
+ *   use custom_fmt ?    NO    (if YES only tooltip active below)
+ *   else
+ *     12hr or 24hr      12hr
+ *     date             (NO if small screen, else YES)
+ *   tooltip date       (YES if small screen, else NO)
+ *
+ * I've adjusted the properties page to reflect this structure....
+ */
+
+static void
 clock_properties(AppletWidget * applet, gpointer data)
 {
-        GtkWidget *hbox;
         GtkWidget *vbox;
-        GtkWidget *hour_frame;
-	GtkWidget *table;
+        GtkWidget *hbox;
+        GtkWidget *label;
+	GtkWidget *formatted;
+	GtkWidget *unixtime;
+        GtkWidget *format_frame;
+        GtkWidget *format_vbox;
+        GtkWidget *standard;
+        GtkWidget *standard_hbox;
+        GtkWidget *hour_hbox;
 	GtkWidget *twelvehour;
 	GtkWidget *twentyfourhour;
 	GtkWidget *showdate;
-	GtkWidget *showtooltip;
-	GtkWidget *unixtime;
-	GtkWidget *internettime;
+	GtkWidget *use_custom_fmt;
+	GtkWidget *custom_fmt;
+	GtkWidget *use_custom_font;
+	GtkWidget *font_picker;
 	GtkWidget *use_gmt_time;
-	ClockData *cd = data;
+	GtkWidget *showtooltip;
 
+	ClockData *cd = data;
 
-	if (cd->props != NULL) {
-		gtk_widget_show_now (cd->props);
-		gdk_window_raise (cd->props->window);
+	if(cd->props) {
+		gdk_window_raise(cd->props->window);
 		return;
 	}
-
 	cd->props = gnome_property_box_new();
 	gtk_window_set_title (GTK_WINDOW (cd->props),
 			      _("Clock properties"));
-	gtk_window_set_wmclass (GTK_WINDOW (cd->props), "clock", "Clock");
 	gnome_window_icon_set_from_file (GTK_WINDOW (cd->props),
 					 GNOME_ICONDIR"/gnome-clock.png");
 
+	vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL);
+
 	hbox = gtk_hbox_new(FALSE, GNOME_PAD);
+	gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+	gtk_widget_show(hbox);
+
+	label = gtk_label_new(_("Show:"));
+	gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
+	gtk_widget_show(label);
+
+	formatted = gtk_radio_button_new_with_label(NULL, _("Formatted"));
+	gtk_box_pack_start (GTK_BOX(hbox), formatted, FALSE, FALSE, 0);
+	gtk_object_set_user_data(GTK_OBJECT(formatted), (gpointer) data);
+	gtk_widget_show(formatted);
+
+	unixtime = gtk_radio_button_new_with_label(
+                          gtk_radio_button_group(GTK_RADIO_BUTTON(formatted)), 
+                                                   _("Unix"));
+	gtk_box_pack_start (GTK_BOX(hbox), unixtime, FALSE, FALSE, 0);
+	gtk_object_set_user_data(GTK_OBJECT(unixtime), (gpointer) data);
+	gtk_widget_show(unixtime);
 
-	hour_frame = gtk_frame_new(_("Time Format"));
-	gtk_container_set_border_width(GTK_CONTAINER(hour_frame), GNOME_PAD);
-	gtk_box_pack_start (GTK_BOX(hbox), hour_frame, FALSE, FALSE, 0);
-
-	table = gtk_table_new(2, 2, FALSE);
-	gtk_container_add(GTK_CONTAINER(hour_frame), table);
-	gtk_widget_show(table);
-
-	gtk_container_set_border_width(GTK_CONTAINER(table), GNOME_PAD);
-	gtk_table_set_row_spacings(GTK_TABLE(table), GNOME_PAD_SMALL);
-	gtk_table_set_col_spacings(GTK_TABLE(table), GNOME_PAD_SMALL);
+	label = gtk_label_new(_("Time"));
+	gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
+	gtk_widget_show(label);
+
+	format_frame = gtk_frame_new(_("Format"));
+	gtk_container_set_border_width(GTK_CONTAINER(format_frame), GNOME_PAD);
+	gtk_box_pack_start (GTK_BOX(vbox), format_frame, FALSE, FALSE, 0);
+	gtk_widget_show(format_frame);
+
+	format_vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL);
+	gtk_container_add(GTK_CONTAINER(format_frame), format_vbox);
+	gtk_widget_show(format_vbox);
+
+	hbox = gtk_hbox_new(FALSE, GNOME_PAD);
+	gtk_box_pack_start (GTK_BOX(format_vbox), hbox, FALSE, FALSE, 0);
+	gtk_widget_show(hbox);
+
+	standard = gtk_radio_button_new_with_label(NULL, _("Standard"));
+	gtk_box_pack_start (GTK_BOX(hbox), standard, FALSE, FALSE, 0);
+	gtk_object_set_user_data(GTK_OBJECT(standard), (gpointer) data);
+	gtk_widget_show(standard);
+
+	standard_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
+	gtk_box_pack_start (GTK_BOX(hbox), standard_hbox, FALSE, FALSE, 0);
+	gtk_widget_show(standard_hbox);
+
+	hour_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
+	gtk_container_add(GTK_CONTAINER(standard_hbox), hour_hbox);
+	gtk_widget_show(hour_hbox);
 
 	twelvehour = gtk_radio_button_new_with_label(NULL, _("12 hour"));
-	gtk_table_attach(GTK_TABLE(table), twelvehour, 0, 1, 0, 1,
-			 GTK_FILL, GTK_FILL | GTK_EXPAND,
-			 0, 0);
+	gtk_box_pack_start (GTK_BOX(hour_hbox), twelvehour, FALSE, FALSE, 0);
 	gtk_object_set_user_data(GTK_OBJECT(twelvehour), (gpointer) data);
 	gtk_widget_show(twelvehour);
 
@@ -787,143 +752,229 @@
 			 gtk_radio_button_group(GTK_RADIO_BUTTON(twelvehour)),
 					        _("24 hour"));
 
-	gtk_table_attach(GTK_TABLE(table), twentyfourhour, 0, 1, 1, 2,
-			 GTK_FILL, GTK_FILL | GTK_EXPAND,
-			 0, 0);
+	gtk_box_pack_start (GTK_BOX(hour_hbox), twentyfourhour, 
+                                                            FALSE, FALSE, 0);
 	gtk_object_set_user_data(GTK_OBJECT(twentyfourhour), (gpointer) data);
 	gtk_widget_show(twentyfourhour);
 
-	switch (cd->hourformat) {
-	case 12:
-		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(twelvehour),
-					    TRUE);
-		break;
-
-	case 24:
-		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(twentyfourhour),
-					    TRUE);
-		break;
+	showdate = gtk_check_button_new_with_label(_("Show date"));
+	gtk_box_pack_start_defaults(GTK_BOX(standard_hbox), showdate);
+	gtk_widget_show(showdate);
+
+	hbox = gtk_hbox_new(FALSE, GNOME_PAD);
+	gtk_box_pack_start (GTK_BOX(format_vbox), hbox, FALSE, FALSE, 0);
+	gtk_widget_show(hbox);
+
+	use_custom_fmt  = gtk_radio_button_new_with_label(
+			 gtk_radio_button_group(GTK_RADIO_BUTTON(standard)),
+					        _("Custom"));
+
+	gtk_box_pack_start (GTK_BOX(hbox), use_custom_fmt, FALSE, FALSE, 0);
+	gtk_object_set_user_data(GTK_OBJECT(use_custom_fmt), (gpointer) data);
+	gtk_widget_show(use_custom_fmt);
+
+        custom_fmt= gtk_entry_new ();
+	gtk_box_pack_start_defaults(GTK_BOX(hbox), custom_fmt);
+	gtk_widget_show(custom_fmt);
+
+	hbox = gtk_hbox_new(FALSE, GNOME_PAD);
+	gtk_box_pack_start (GTK_BOX(format_vbox), hbox, FALSE, FALSE, 0);
+	gtk_widget_show(hbox);
+
+	use_gmt_time = 
+                    gtk_check_button_new_with_label(_("Use GMT"));
+	gtk_box_pack_start_defaults(GTK_BOX(hbox), use_gmt_time);
+	gtk_widget_show(use_gmt_time);
+	
+	hbox = gtk_hbox_new(FALSE, GNOME_PAD);
+	gtk_box_pack_start (GTK_BOX(format_vbox), hbox, FALSE, FALSE, 0);
+	gtk_widget_show(hbox);
+
+	showtooltip = 
+                    gtk_check_button_new_with_label(_("Show date in tooltip"));
+	gtk_box_pack_start_defaults(GTK_BOX(hbox), showtooltip);
+	gtk_widget_show(showtooltip);
+	
+	hbox = gtk_hbox_new(FALSE, GNOME_PAD);
+	gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+	gtk_widget_show(hbox);
+
+	use_custom_font = 
+                    gtk_check_button_new_with_label(_("Font"));
+	gtk_box_pack_start_defaults(GTK_BOX(hbox), use_custom_font);
+	gtk_widget_show(use_custom_font);
+
+        cd->font_entry = gtk_entry_new ();
+
+	gtk_box_pack_start_defaults(GTK_BOX(hbox), cd->font_entry);
+	gtk_widget_show(cd->font_entry);
+
+        font_picker = gnome_font_picker_new();
+        gnome_font_picker_set_mode(GNOME_FONT_PICKER (font_picker),
+                                   GNOME_FONT_PICKER_MODE_USER_WIDGET);
+        
+
+        label = gtk_label_new (_("Browse..."));
+	gtk_widget_show(label);
+
+        gnome_font_picker_uw_set_widget(GNOME_FONT_PICKER(font_picker), 
+                                        GTK_WIDGET(label));
+	gtk_object_set_user_data(GTK_OBJECT(font_picker), 
+                                 GTK_OBJECT(cd->font_entry)); 
+	gtk_object_set_user_data(GTK_OBJECT(cd->font_entry), 
+                                 GTK_OBJECT(font_picker)); 
+
+	gtk_box_pack_start_defaults(GTK_BOX(hbox), font_picker);
+	gtk_widget_show(font_picker);
+
+        /* What is, isn't active, sensitive, etc */
+
+	if (cd->unixtime) {
+	        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(unixtime), TRUE);
+	        gtk_widget_set_sensitive(format_frame, FALSE);
+        } else {
+	        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(formatted),TRUE);
+	        gtk_widget_set_sensitive(format_frame, TRUE);
 	}
+	cd->prop_unixtime = cd->unixtime;
 
+        if (cd->hourformat)
+	        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(twentyfourhour),
+                                                                          TRUE);
+        else
+	        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(twelvehour),
+                                                                          TRUE);
 	cd->prop_hourformat = cd->hourformat;
 
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(showdate), cd->showdate);
+	cd->prop_showdate = cd->showdate;
+
+        if (cd->use_custom_fmt) {
+	        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_custom_fmt),
+					                                 TRUE);
+                gtk_widget_set_sensitive(standard_hbox, FALSE); 
+                gtk_widget_set_sensitive(custom_fmt, TRUE); 
+        } else {
+	        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(standard),
+					                                 TRUE);
+                gtk_widget_set_sensitive(standard_hbox, TRUE); 
+                gtk_widget_set_sensitive(custom_fmt, FALSE); 
+	}
+	cd->prop_use_custom_fmt = cd->use_custom_fmt;
+
+        gtk_entry_set_text (GTK_ENTRY (custom_fmt), cd->custom_fmt ? 
+                                          cd->custom_fmt : DEFAULT_CUSTOM_FMT);
+	cd->prop_custom_fmt = g_strdup(cd->custom_fmt);
+
+        if (cd->use_custom_font) {
+	        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_custom_font),
+					                                  TRUE);
+                gtk_widget_set_sensitive(cd->font_entry, TRUE); 
+                gtk_widget_set_sensitive(font_picker, TRUE); 
+	} else {
+                gtk_widget_set_sensitive(cd->font_entry, FALSE); 
+                gtk_widget_set_sensitive(font_picker, FALSE); 
+	}
+	cd->prop_use_custom_font = cd->use_custom_font;
+
+	if (!cd->custom_font)
+	        cd->custom_font = g_strdup( DEFAULT_CUSTOM_FONT);
+
+        gtk_entry_set_text (GTK_ENTRY (cd->font_entry), cd->custom_font ); 
+	
+	gnome_font_picker_set_font_name(GNOME_FONT_PICKER(font_picker), 
+			       gtk_entry_get_text(GTK_ENTRY (cd->font_entry)));
+
+	cd->prop_custom_font = g_strdup(cd->custom_font);
+
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_gmt_time),
+					                      cd->gmt_time);
+	cd->prop_gmt_time = cd->gmt_time;
+
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(showtooltip),
+					                       cd->showtooltip);
+	cd->prop_showtooltip = cd->showtooltip;
+
+        /* the primary callbacks for each button */
+
+	gtk_signal_connect(GTK_OBJECT(unixtime),
+			   "toggled",
+			   (GtkSignalFunc) set_unixtime_cb,
+			   data);
+
+	gtk_signal_connect(GTK_OBJECT(standard),
+			   "toggled",
+			   (GtkSignalFunc) set_custom_fmt_cb,
+			   (gpointer) 0);
+
 	gtk_signal_connect(GTK_OBJECT(twelvehour),
 			   "toggled",
 			   (GtkSignalFunc) set_hour_format_cb,
-			   (gpointer) 12);
+			   (gpointer) 0);
 	gtk_signal_connect(GTK_OBJECT(twentyfourhour),
 			   "toggled",
 			   (GtkSignalFunc) set_hour_format_cb,
-			   (gpointer) 24);
-	
-	vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL);
-	gtk_box_pack_start_defaults(GTK_BOX(hbox), vbox);
-	gtk_widget_show(vbox);
-
-	showdate = gtk_check_button_new_with_label(_("Show date in applet"));
-	gtk_box_pack_start_defaults(GTK_BOX(vbox), showdate);
-	gtk_widget_show(showdate);
-	
-	if (cd->showdate)
-	  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(showdate),
-				      TRUE);
-	cd->prop_showdate = cd->showdate;
+			   (gpointer) 1);
 	
 	gtk_signal_connect(GTK_OBJECT(showdate),
 			   "toggled",
 			   (GtkSignalFunc) set_show_date_cb,
 			   data);	   
 
-	showtooltip = gtk_check_button_new_with_label(_("Show date in tooltip"));
-	gtk_box_pack_start_defaults(GTK_BOX(vbox), showtooltip);
-	gtk_widget_show(showtooltip);
-	
-	if (cd->showtooltip)
-	  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(showtooltip),
-				      TRUE);
-	cd->prop_showtooltip = cd->showtooltip;
-	
-	gtk_signal_connect(GTK_OBJECT(showtooltip),
+	gtk_signal_connect(GTK_OBJECT(use_custom_fmt),
 			   "toggled",
-			   (GtkSignalFunc) set_show_tooltip_cb,
-			   data);	
+			   (GtkSignalFunc) set_custom_fmt_cb,
+			   (gpointer) 1);
+
+        gtk_signal_connect (GTK_OBJECT (custom_fmt), "changed",
+                            GTK_SIGNAL_FUNC (changed_custom_fmt_cb), data);
+
+	gtk_signal_connect(GTK_OBJECT(use_custom_font),
+			   "toggled",
+			   (GtkSignalFunc) set_custom_font_cb,
+			   data);
+
+        gtk_signal_connect (GTK_OBJECT (cd->font_entry), "changed",
+                            GTK_SIGNAL_FUNC (changed_custom_font_cb), data);
+
+        gtk_signal_connect (GTK_OBJECT (font_picker), "font_set",
+                            GTK_SIGNAL_FUNC (changed_custom_font_cb), data);
 
-	use_gmt_time = gtk_check_button_new_with_label(_("Use GMT"));
-	gtk_box_pack_start_defaults(GTK_BOX(vbox), use_gmt_time);
-	gtk_widget_show(use_gmt_time);
-	
-	if (cd->gmt_time)
-	  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_gmt_time),
-				      TRUE);
-	cd->prop_gmt_time = cd->gmt_time;
-	
 	gtk_signal_connect(GTK_OBJECT(use_gmt_time),
 			   "toggled",
 			   (GtkSignalFunc) set_gmt_time_cb,
 			   data);	
 
-	unixtime = gtk_check_button_new_with_label(_("Unix time"));
-	gtk_box_pack_start_defaults(GTK_BOX(vbox), unixtime);
-	gtk_widget_show(unixtime);
+	gtk_signal_connect(GTK_OBJECT(showtooltip),
+			   "toggled",
+			   (GtkSignalFunc) set_show_tooltip_cb,
+			   data);	
+
+        /* further connections to keep sensitivity set ok */
 
-        internettime = gtk_check_button_new_with_label(_("Internet time"));
-	gtk_box_pack_start_defaults(GTK_BOX(vbox), internettime);
-	gtk_widget_show(internettime);
-   
-        gtk_signal_connect(GTK_OBJECT(unixtime), "toggled",
-			   (GtkSignalFunc) set_datasensitive_cb,
-			   hour_frame);
-	gtk_signal_connect(GTK_OBJECT(unixtime), "toggled",
-			   (GtkSignalFunc) set_datasensitive_cb,
-			   showdate);
-	gtk_signal_connect(GTK_OBJECT(unixtime), "toggled",
-			   (GtkSignalFunc) set_datasensitive_cb,
-			   showtooltip);
-	gtk_signal_connect(GTK_OBJECT(unixtime), "toggled",
-			   (GtkSignalFunc) set_datasensitive_cb,
-			   use_gmt_time);
 	gtk_signal_connect(GTK_OBJECT(unixtime), "toggled",
 			   (GtkSignalFunc) set_datasensitive_cb,
-			   internettime);
-			   
-	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(unixtime),
-				     cd->unixtime);
-	cd->prop_unixtime = cd->unixtime;
-
+			   format_frame);
 
-/* internet time */
-	gtk_signal_connect(GTK_OBJECT(internettime), "toggled",
+	gtk_signal_connect(GTK_OBJECT(standard), "toggled",
 			   (GtkSignalFunc) set_datasensitive_cb,
-			   hour_frame);
-	gtk_signal_connect(GTK_OBJECT(internettime), "toggled",
-			   (GtkSignalFunc) set_datasensitive_cb,
-			   showdate);
-	gtk_signal_connect(GTK_OBJECT(internettime), "toggled",
-			   (GtkSignalFunc) set_datasensitive_cb,
-			   showtooltip);
-	gtk_signal_connect(GTK_OBJECT(internettime), "toggled",
-			   (GtkSignalFunc) set_datasensitive_cb,
-			   use_gmt_time);   
-	gtk_signal_connect(GTK_OBJECT(internettime), "toggled",
+			   custom_fmt);
+
+	gtk_signal_connect(GTK_OBJECT(use_custom_fmt), "toggled",
 			   (GtkSignalFunc) set_datasensitive_cb,
-			   unixtime);   
-   
-        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(internettime),
-				     cd->internettime);
-	cd->prop_internettime = cd->internettime;
-/* */
-   
-	gtk_signal_connect(GTK_OBJECT(unixtime), "toggled",
-			   (GtkSignalFunc) set_unixtime_cb,
-			   data);
-	gtk_signal_connect(GTK_OBJECT(internettime), "toggled",
-			   (GtkSignalFunc) set_internettime_cb,
-			   data);
+			   standard_hbox);
 
-	gtk_widget_show(hour_frame);
-	gtk_widget_show(hbox);
+	gtk_signal_connect(GTK_OBJECT(use_custom_font), "toggled",
+			   (GtkSignalFunc) set_datainsensitive_cb,
+			   cd->font_entry);
+
+	gtk_signal_connect(GTK_OBJECT(use_custom_font), "toggled",
+			   (GtkSignalFunc) set_datainsensitive_cb,
+			   font_picker);
+
+	gtk_widget_show(vbox);
 
-	gnome_property_box_append_page(GNOME_PROPERTY_BOX(cd->props), hbox,
+	gnome_property_box_append_page(GNOME_PROPERTY_BOX(cd->props), vbox,
 				       gtk_label_new(_("Clock")));
 	gtk_signal_connect(GTK_OBJECT(cd->props), "apply",
 			   GTK_SIGNAL_FUNC(apply_properties), data);
@@ -937,7 +988,7 @@
 }
 
 static void
-help_cb (AppletWidget *w, gpointer data)
+help_cb (GtkWidget *w, gpointer data)
 {
 	GnomeHelpMenuEntry help_entry = { "clock_applet" };
 
@@ -948,7 +999,7 @@
 static void
 phelp_cb (GtkWidget *w, gint tab, gpointer data)
 {
-	help_cb (NULL, data);
+	help_cb (w, data);
 }
 
 static void
@@ -960,23 +1011,22 @@
 		"Miguel de Icaza <miguel@kernel.org>",
 		"Federico Mena <quartic@gimp.org>",
 		"Stuart Parmenter <pavlov@innerx.net>",
-		"George Lebl <jirka@5z.com>",
-		NULL
+		"Mike Capell <Michael.Capell@Cern.Ch>",
+	NULL
 	};
 
 	if (about != NULL)
 	{
-		gtk_widget_show_now (about);
+		gdk_window_show (about->window);
 		gdk_window_raise (about->window);
 		return;
 	}
 	
-	about = gnome_about_new (_("Clock Applet"), "1.0",
-				 _("(c) 1998-2001 the Free Software Foundation"),
+	about = gnome_about_new (_("Clock Applet"), "1.001",
+				 _("(c) 1998 the Free Software Foundation"),
 				 authors,
-				 _("The clock applet gives your panel a lightweight and simple display of the date and time"),
+				 _("The clock applet gives your panel a `lightweight' and simple display of the date and time"),
 				 GNOME_ICONDIR"/gnome-clock.png");
-	gtk_window_set_wmclass (GTK_WINDOW (about), "clock", "Clock");
 	gnome_window_icon_set_from_file (GTK_WINDOW (about),
 					 GNOME_ICONDIR"/gnome-clock.png");
 	gtk_signal_connect (GTK_OBJECT(about), "destroy",
