comparison lisp/toolbar/tool-bar.el @ 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 0d7cddbc0fa7
children c187056ac630
comparison
equal deleted inserted replaced
39018:23eee4af37c1 39019:a9bd717014f0
48 See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for 48 See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for
49 conveniently adding tool bar items." 49 conveniently adding tool bar items."
50 :global t 50 :global t
51 :group 'mouse 51 :group 'mouse
52 :group 'frames 52 :group 'frames
53 (let ((lines (if tool-bar-mode 1 0))) 53 (and (display-images-p)
54 ;; Alter existing frames... 54 (let ((lines (if tool-bar-mode 1 0)))
55 (mapc (lambda (frame) 55 ;; Alter existing frames...
56 (modify-frame-parameters frame 56 (mapc (lambda (frame)
57 (list (cons 'tool-bar-lines lines)))) 57 (modify-frame-parameters frame
58 (frame-list)) 58 (list (cons 'tool-bar-lines lines))))
59 ;; ...and future ones. 59 (frame-list))
60 (let ((elt (assq 'tool-bar-lines default-frame-alist))) 60 ;; ...and future ones.
61 (if elt 61 (let ((elt (assq 'tool-bar-lines default-frame-alist)))
62 (setcdr elt lines) 62 (if elt
63 (add-to-list 'default-frame-alist (cons 'tool-bar-lines lines))))) 63 (setcdr elt lines)
64 (if (and tool-bar-mode 64 (add-to-list 'default-frame-alist (cons 'tool-bar-lines lines)))))
65 (display-graphic-p) 65 (if (and tool-bar-mode
66 (= 1 (length (default-value 'tool-bar-map)))) ; not yet setup 66 (display-graphic-p)
67 (tool-bar-setup))) 67 (= 1 (length (default-value 'tool-bar-map)))) ; not yet setup
68 (tool-bar-setup))))
68 69
69 (defvar tool-bar-map (make-sparse-keymap) 70 (defvar tool-bar-map (make-sparse-keymap)
70 "Keymap for the tool bar. 71 "Keymap for the tool bar.
71 Define this locally to override the global tool bar.") 72 Define this locally to override the global tool bar.")
72 73