changeset 39019:a9bd717014f0

(tool-bar-mode): Make it a no-op if images aren't supported. This avoids the annoying grey strip drawn by the Windows version instead of the missing tool bar.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 30 Aug 2001 06:50:59 +0000
parents 23eee4af37c1
children 758df10fd66b
files lisp/toolbar/tool-bar.el
diffstat 1 files changed, 16 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/toolbar/tool-bar.el	Wed Aug 29 15:15:41 2001 +0000
+++ b/lisp/toolbar/tool-bar.el	Thu Aug 30 06:50:59 2001 +0000
@@ -50,21 +50,22 @@
   :global t
   :group 'mouse
   :group 'frames
-  (let ((lines (if tool-bar-mode 1 0)))
-    ;; Alter existing frames...
-    (mapc (lambda (frame)
-	    (modify-frame-parameters frame
-				     (list (cons 'tool-bar-lines lines))))
-	  (frame-list))
-    ;; ...and future ones.
-    (let ((elt (assq 'tool-bar-lines default-frame-alist)))
-      (if elt
-	  (setcdr elt lines)
-	(add-to-list 'default-frame-alist (cons 'tool-bar-lines lines)))))
-  (if (and tool-bar-mode
-	   (display-graphic-p)
-	   (= 1 (length (default-value 'tool-bar-map)))) ; not yet setup
-      (tool-bar-setup)))
+  (and (display-images-p)
+       (let ((lines (if tool-bar-mode 1 0)))
+	 ;; Alter existing frames...
+	 (mapc (lambda (frame)
+		 (modify-frame-parameters frame
+					  (list (cons 'tool-bar-lines lines))))
+	       (frame-list))
+	 ;; ...and future ones.
+	 (let ((elt (assq 'tool-bar-lines default-frame-alist)))
+	   (if elt
+	       (setcdr elt lines)
+	     (add-to-list 'default-frame-alist (cons 'tool-bar-lines lines)))))
+       (if (and tool-bar-mode
+		(display-graphic-p)
+		(= 1 (length (default-value 'tool-bar-map)))) ; not yet setup
+	   (tool-bar-setup))))
 
 (defvar tool-bar-map (make-sparse-keymap)
   "Keymap for the tool bar.