From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Newsgroups: gmane.emacs.help Subject: emacs 23, adding 2 buttons/icons to beginning of toolbar. howto? Date: Wed, 24 Jun 2009 15:53:28 +0200 Organization: education Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1245858302 1723 80.91.229.12 (24 Jun 2009 15:45:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2009 15:45:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 24 17:44:55 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MJUec-0001ds-Oz for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2009 17:44:55 +0200 Original-Received: from localhost ([127.0.0.1]:50755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJUea-0006Vj-Tg for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2009 11:44:53 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!nx02.iad01.newshosting.com!newshosting.com!83.128.0.11.MISMATCH!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!newsfeed00.sul.t-online.de!t-online.de!news.task.gda.pl!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: jupiter.adlex.com Original-X-Trace: news.task.gda.pl 1245851696 1990 157.25.157.162 (24 Jun 2009 13:54:56 GMT) Original-X-Complaints-To: abuse@news.task.gda.pl Original-NNTP-Posting-Date: Wed, 24 Jun 2009 13:54:56 +0000 (UTC) X-Mailer: KMail/1.7.1 User-Agent: mozilla news reader Cancel-Lock: sha1:9pgKaF+r43BwmwkdW4wfpK11GzA= Original-Xref: news.stanford.edu gnu.emacs.help:170264 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65484 Archived-At: 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