all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs 23, adding 2 buttons/icons to beginning of toolbar. howto?
@ 2009-06-24 13:53 Michal
  2009-06-24 19:02 ` TomSW
  0 siblings, 1 reply; 5+ messages in thread
From: Michal @ 2009-06-24 13:53 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-25 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-24 13:53 emacs 23, adding 2 buttons/icons to beginning of toolbar. howto? Michal
2009-06-24 19:02 ` TomSW
2009-06-25 10:09   ` Michal
2009-06-25 13:48     ` TomSW
2009-06-25 16:16       ` Michal

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.