Discussion:
Trying to rebind menu widgets
(too old to reply)
Davin Pearson
2010-04-15 03:56:39 UTC
Permalink
I am trying to rebing <tool-bar> <kill-buffer> to d-kill-buffer, my
own creation. Here is the code that I have tried to use but failed:

(global-set-key [<tool-bar> <kill-buffer>] 'd-kill-buffer)

This doesn't work as after executing this command, the mouse clicks
are still bound to kill-this-buffer, which I don't want. Would
someone be able to help me with the solution to this problem?
Davin Pearson
2010-04-17 08:39:18 UTC
Permalink
Post by Davin Pearson
I am trying to rebing <tool-bar> <kill-buffer> to d-kill-buffer, my
(global-set-key [<tool-bar> <kill-buffer>] 'd-kill-buffer)
This doesn't work as after executing this command, the mouse clicks
are still bound to kill-this-buffer, which I don't want.  Would
someone be able to help me with the solution to this problem?
Sorry for wasting your time but I finally got it to work using the
following code:

(define-key
global-map
[tool-bar kill-buffer]
'(menu-item
"Maybe Kill Buffer"
d-kill-buffer
:enable 1
:visible 1
:help "Maybe Kill Buffer"
:image (image :type xpm :file "../etc/images/close.xpm")
))

Loading...