Function: tool-bar-local-item
tool-bar-local-item is an autoloaded and byte-compiled function
defined in tool-bar.el.gz.
Signature
(tool-bar-local-item ICON DEF KEY MAP &rest PROPS)
Documentation
Add an item to the tool bar in map MAP.
ICON names the image, DEF is the key definition and KEY is a symbol for the fake function key in the menu keymap. Remaining arguments PROPS are additional items to add to the menu item specification. See Info node (elisp)Tool Bar. Items are added from left to right.
ICON is the base name of a file containing the image to use. The
function will first try to use low-color/ICON.xpm if display-color-cells
is less or equal to 256, then ICON.xpm, then ICON.pbm, and finally
ICON.xbm, using find-image.
Source Code
;; Defined in /usr/src/emacs/lisp/tool-bar.el.gz
;;;###autoload
(defun tool-bar-local-item (icon def key map &rest props)
"Add an item to the tool bar in map MAP.
ICON names the image, DEF is the key definition and KEY is a symbol
for the fake function key in the menu keymap. Remaining arguments
PROPS are additional items to add to the menu item specification. See
Info node `(elisp)Tool Bar'. Items are added from left to right.
ICON is the base name of a file containing the image to use. The
function will first try to use low-color/ICON.xpm if `display-color-cells'
is less or equal to 256, then ICON.xpm, then ICON.pbm, and finally
ICON.xbm, using `find-image'."
(let* ((image-exp (tool-bar--image-expression icon)))
(define-key-after map (vector key)
`(menu-item ,(symbol-name key) ,def :image ,image-exp ,@props))
(force-mode-line-update)))