Commits

steveb  committed 9ab8f58

Guard against not having toolbar support

  • Participants
  • Parent commits a477176

Comments (0)

Files changed (3)

+1998-12-09  SL Baur  <steve@altair.xemacs.org>
+
+	* mew/mew-xemacs.el (mew-icon-separate): Guard against no toolbars.
+	(mew-icon-blank): Ditto.
+	(mew-icon-audio): Ditto.
+	(mew-icon-image): Ditto.
+	(mew-icon-video): Ditto.
+	(mew-icon-application/postscript): Ditto.
+	(mew-icon-application/octet-stream): Ditto.
+	(mew-icon-message/rfc822): Ditto.
+	(mew-icon-message/external-body): Ditto.
+	(mew-icon-text): Ditto.
+	(mew-icon-multipart): Ditto.
+	(mew-icon-unknown): Ditto.
+	(mew-summary-toolbar-icon-show): Ditto.
+	(mew-summary-toolbar-icon-next): Ditto.
+	(mew-summary-toolbar-icon-prev): Ditto.
+	(mew-summary-toolbar-icon-inc): Ditto.
+	(mew-summary-toolbar-icon-write): Ditto.
+	(mew-summary-toolbar-icon-reply): Ditto.
+	(mew-summary-toolbar-icon-forward): Ditto.
+	(mew-summary-toolbar-icon-refile): Ditto.
+	(mew-draft-toolbar-icon-comp): Ditto.
+	(mew-draft-toolbar-icon-send): Ditto.
+	(mew-draft-toolbar-icon-attach): Ditto.
+	(mew-draft-toolbar-icon-cite): Ditto.
+	(mew-draft-toolbar-icon-yank): Ditto.
+	(mew-draft-toolbar-icon-pgp-sign): Ditto.
+	(mew-draft-toolbar-icon-pgp-enc): Ditto.
+	(mew-draft-toolbar-icon-pgp-sigenc): Ditto.
+	(toplevel): Don't bind to `toolbar-map' unconditionally.
+	
 1998-06-21  SL Baur  <steve@altair.xemacs.org>
 
 	* mew/mew-xemacs.el (mew-icon-directory): XEmacs 21 can find the
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-VERSION = 1.05
-AUTHOR_VERSION = 1.93b38
+VERSION = 1.06
+AUTHOR_VERSION = 1.93b38x1
 MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
 PACKAGE = mew
 PKG_TYPE = regular

File mew/mew-xemacs.el

 			       (locate-data-directory "mew")))
 
 (defvar mew-icon-separate
-  (toolbar-make-button-list
-   (expand-file-name "mew-sep.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-sep.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-separate-spec
   (list [mew-icon-separate nil nil ""]))
 
 (defvar mew-icon-blank
-  (toolbar-make-button-list
-   (expand-file-name "mew-Blank.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Blank.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-audio 
-  (toolbar-make-button-list
-   (expand-file-name "mew-Audio.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Audio.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-image
-  (toolbar-make-button-list
-   (expand-file-name "mew-Image.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Image.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-video
-  (toolbar-make-button-list
-   (expand-file-name "mew-Video.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Video.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-application/postscript
-  (toolbar-make-button-list
-   (expand-file-name "mew-Postscript.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Postscript.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-application/octet-stream
-  (toolbar-make-button-list
-   (expand-file-name "mew-Octet-Stream.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Octet-Stream.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-message/rfc822
-  (toolbar-make-button-list
-   (expand-file-name "mew-Rfc822.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Rfc822.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-message/external-body
-  (toolbar-make-button-list
-   (expand-file-name "mew-External.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-External.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-text
-  (toolbar-make-button-list
-   (expand-file-name "mew-Text.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Text.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-multipart
-  (toolbar-make-button-list
-   (expand-file-name "mew-Folder.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Folder.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-icon-unknown
-  (toolbar-make-button-list
-   (expand-file-name "mew-Unknown.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-Unknown.xpm" mew-icon-directory))
+    ))
 
 ;;
 ;; Summary mode
 ;;
 
 (defvar mew-summary-toolbar-icon-show
-  (toolbar-make-button-list
-   (expand-file-name "mew-show.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-show.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-summary-toolbar-icon-next
-  (toolbar-make-button-list
-   (expand-file-name "mew-next.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-next.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-summary-toolbar-icon-prev
-  (toolbar-make-button-list
-   (expand-file-name "mew-prev.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-prev.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-summary-toolbar-icon-inc
-  (toolbar-make-button-list
-   (expand-file-name "mew-inc.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-inc.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-summary-toolbar-icon-write
-  (toolbar-make-button-list
-   (expand-file-name "mew-write.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-write.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-summary-toolbar-icon-reply
-  (toolbar-make-button-list
-   (expand-file-name "mew-reply.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-reply.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-summary-toolbar-icon-forward
-  (toolbar-make-button-list
-   (expand-file-name "mew-forward.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-forward.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-summary-toolbar-icon-refile
-  (toolbar-make-button-list
-   (expand-file-name "mew-refile.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-refile.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-summary-toolbar
   '(
 ;;
 
 (defvar mew-draft-toolbar-icon-comp
-  (toolbar-make-button-list
-   (expand-file-name "mew-comp.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-comp.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-draft-toolbar-icon-send
-  (toolbar-make-button-list
-   (expand-file-name "mew-send.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-send.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-draft-toolbar-icon-attach
-  (toolbar-make-button-list
-   (expand-file-name "mew-attach.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-attach.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-draft-toolbar-icon-cite
-  (toolbar-make-button-list
-   (expand-file-name "mew-cite.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-cite.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-draft-toolbar-icon-yank
-  (toolbar-make-button-list
-   (expand-file-name "mew-yank.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-yank.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-draft-toolbar-icon-pgp-sign
-  (toolbar-make-button-list
-   (expand-file-name "mew-pgp-sign.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-pgp-sign.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-draft-toolbar-icon-pgp-enc
-  (toolbar-make-button-list
-   (expand-file-name "mew-pgp-enc.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-pgp-enc.xpm" mew-icon-directory))
+    ))
 
 
 (defvar mew-draft-toolbar-icon-pgp-sigenc
-  (toolbar-make-button-list
-   (expand-file-name "mew-pgp-sigenc.xpm" mew-icon-directory))
-  )
+  (when (fboundp 'toolbar-make-button-list)
+    (toolbar-make-button-list
+     (expand-file-name "mew-pgp-sigenc.xpm" mew-icon-directory))
+    ))
 
 (defvar mew-draft-toolbar
   '(
 ;; Button
 ;; 
 
-(define-key toolbar-map 'button3   'pressed-and-activate-toolbar-button)
-(define-key toolbar-map 'button3up 'release-and-activate-toolbar-button)
+(when (boundp 'toolbar-map)
+  (define-key toolbar-map 'button3   'pressed-and-activate-toolbar-button)
+  (define-key toolbar-map 'button3up 'release-and-activate-toolbar-button))
 
 (defun mew-summary-button ()
   (interactive)