changeset 24992:f1632be03391

(x_load_resources): Set double-click time defaults for Motif list boxes from double-click-time. (x_load_resources): Add default resoures for file selection dialog. (x_load_resources): Add grey background colors as defaults for menus, scroll bars, and dialogs. (x_load_resources): Add font defaults for menus and dialogs.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 21 Jul 1999 21:43:52 +0000
parents 53d428012caf
children 825f11b1c34d
files src/xrdb.c
diffstat 1 files changed, 70 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xrdb.c	Wed Jul 21 21:43:52 1999 +0000
+++ b/src/xrdb.c	Wed Jul 21 21:43:52 1999 +0000
@@ -62,6 +62,8 @@
 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
 #endif
 
+#include "lisp.h"
+
 extern char *getenv ();
 
 /* This does cause trouble on AIX.  I'm going to take the comment at
@@ -526,6 +528,10 @@
   XrmDatabase user_database;
   XrmDatabase rdb;
   XrmDatabase db;
+  char line[256];
+  char *helv = "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1";
+  char *courier = "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1";
+  extern Lisp_Object Vdouble_click_time;
 
   x_rm_string = XrmStringToQuark (XrmStringType);
 #ifndef USE_X_TOOLKIT
@@ -535,6 +541,70 @@
 #endif
   rdb = XrmGetStringDatabase ("");
 
+  /* Add some font defaults.  If the font `helv' doesn't exist, widgets
+     will use some other default font.  */
+#ifdef USE_MOTIF
+  
+  sprintf (line, "%s*fontList: %s", myname, helv);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*menu*background: grey75", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*menubar*background: grey75", myname, helv);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*verticalScrollBar.background: grey75", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s.dialog*.background: grey75", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb.Text.background: white", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb.FilterText.background: white", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb*DirList.background: white", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb*ItemsList.background: white", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb*background: grey75", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb.Text.fontList: %s", myname, courier);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb.FilterText.fontList: %s", myname, courier);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb*ItemsList.fontList: %s", myname, courier);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*fsb*DirList.fontList: %s", myname, courier);
+  XrmPutLineResource (&rdb, line);
+
+  /* Set double click time of list boxes in the file selection
+     dialog from `double-click-time'.  */
+  if (INTEGERP (Vdouble_click_time) && XINT (Vdouble_click_time) > 0)
+    {
+      sprintf (line, "%s*fsb*DirList.doubleClickInterval: %d",
+	       myname, XFASTINT (Vdouble_click_time));
+      XrmPutLineResource (&rdb, line);
+      sprintf (line, "%s*fsb*ItemsList.doubleClickInterval: %d",
+	       myname, XFASTINT (Vdouble_click_time));
+      XrmPutLineResource (&rdb, line);
+    }
+
+#else /* not USE_MOTIF */
+  
+  sprintf (line, "%s.dialog*.font: %s", myname, helv);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s.dialog*.background: grey75", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s.pane.menubar.font: %s", myname, helv);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s.pane.menubar.background: grey75", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s.menu*.font: %s", myname, helv);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s.menu*.background: grey75", myname);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*verticalScrollBar.background: grey75", myname);
+  XrmPutLineResource (&rdb, line);
+  
+#endif /* not USE_MOTIF */
+
   user_database = get_user_db (display);
 
   /* Figure out what the "customization string" is, so we can use it