Subject: 24.0.50; GUI toolkit differences

From: Tim Cross <[email-masked]>
Date: Sat, 05 Mar 2011 15:13:44 +1100

The code below works under some GUI toolkits (i.e. windows, lucid and I
think GNUStep), but will not work under versions built with GTK. From a
discussion on the emacs-dev list, this appears to be due to design
constraints with the GTK toolkit, which will not allow menu
actions/buttons to be defined at the top level. I tried to verify this
using the GTK documentation, but was unable to find anything specific. 

Either this is a bug in GTK or how emacs interfaces with the library
(seems unlikely, more likely a desing constraint of GTK) and should be
fixed or a footnote added to the manual to let developers know of this
limitation in some toolkits, noteably GTK based ones.

The following code was evaluated within the scratch buffer. I confirmed
it works fine under emacs 24 built with lucid, but fails to work when
built with GTK2+. Others reported it worked find under win32, but failed
on ns. 

(defun tx-greet ()
  (interactive) 
  (message "Hello Tim!"))

(defun tx-menu ()
  (interactive)
  (define-key lisp-interaction-mode-map [menu-bar tx]
    '(menu-item "TX Test" tx-greet)))

Tim

-- 
Tim Cross
[email-masked]

There are two types of people in IT - those who do not manage what they 
understand and those who do not understand what they manage.