all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michal <rabbitko@tenbit.pl>
To: help-gnu-emacs@gnu.org
Subject: emacs 23, adding 2 buttons/icons to beginning of toolbar. howto?
Date: Wed, 24 Jun 2009 15:53:28 +0200	[thread overview]
Message-ID: <m2eit9n3fr.fsf@tenbit.pl> (raw)

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	other threads:[~2009-06-24 13:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-24 13:53 Michal [this message]
2009-06-24 19:02 ` emacs 23, adding 2 buttons/icons to beginning of toolbar. howto? TomSW
2009-06-25 10:09   ` Michal
2009-06-25 13:48     ` TomSW
2009-06-25 16:16       ` Michal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2eit9n3fr.fsf@tenbit.pl \
    --to=rabbitko@tenbit.pl \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.