help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs 23, adding 2 buttons/icons to beginning of toolbar. howto?


From: Michal
Subject: emacs 23, adding 2 buttons/icons to beginning of toolbar. howto?
Date: Wed, 24 Jun 2009 15:53:28 +0200
User-agent: mozilla news reader

I wanted to add 2 buttons to toolbar. These buttons were expected
to go through (back and forward) a list of c-mode and c++-mode buffers.

So I added them to the end of toolbar related to c-mode and c++-mode.
Something like:

(setq emacs-images "/tmp")
(add-hook 'c-mode-hook
          (lambda ()
            (define-key c-mode-map [tool-bar csearch-forw]
              `(menu-item "csearch forward" csearch-forward
                          :image (image :type xpm :file ,(concat emacs-images 
"/right-arrow.xpm"))))
            (define-key c-mode-map [tool-bar csearch-back]
              `(menu-item "csearch backward" csearch-backward
                          :image (image :type xpm :file ,(concat emacs-images 
"/left-arrow.xpm"))))))


(the same for c++-mode-hook).

It shortly turned out that when I run gdb, the length of toolbar changes
in c/c++ files "visited" by gdb.
When I am pressing my backward button on an on through let's say
non-gdb c/c++ files, I do not have to move mouse pointer because
position of my backward button does not change, but when next buffer
that is visited is gdb c/c++ one, then toolbar icons list is shorter
thus my backward button also gets moved and I have to move my mouse
pointer.

I see solving this by adding my 2 icons/buttons to the beginning of the
toolbar list, but how to do this, and how to do this only for c/c++
buffers also those visited by gdb?

best regards,
Michal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]