GNU bug report logs -
#8176
24.0.50; GUI toolkit differences
Previous Next
Reported by: Tim Cross <theophilusx <at> gmail.com>
Date: Sat, 5 Mar 2011 04:14:02 UTC
Severity: minor
Tags: fixed
Found in version 24.0.50
Fixed in version 24.1
Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8176 in the body.
You can then email your comments to 8176 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Sat, 05 Mar 2011 04:14:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tim Cross <theophilusx <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 05 Mar 2011 04:14:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
tcross <at> rapttech.com.au
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.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Mon, 04 Jul 2011 14:07:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 8176 <at> debbugs.gnu.org (full text, mbox):
Tim Cross <theophilusx <at> gmail.com> writes:
> 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)))
I can confirm that this doesn't work under GTK Emacs.
Do you have a suggestion where this limitation should be documented?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Tue, 05 Jul 2011 00:02:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 8176 <at> debbugs.gnu.org (full text, mbox):
On Tue, Jul 5, 2011 at 12:05 AM, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:
> Tim Cross <theophilusx <at> gmail.com> writes:
>
>> 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)))
>
> I can confirm that this doesn't work under GTK Emacs.
>
> Do you have a suggestion where this limitation should be documented?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog http://lars.ingebrigtsen.no/
>
My suggestion would be to add it to the elisp manual, possibly as a
footnote, in either section 22.17 or possibly 22.17.1. Something along
the lines that not all GUI toolkits are equal and some features or
behaviours available in one toolkit may not be available in another.
For example, GTK will not allow a top level menu button or action,
while Lucid and NS do.
A tricky part in documenting this is getting consistency of terms. I'm
not sure if 'top level button or action' is really understood, but
basically it refers to a menu item on the top level menu bar which
performs an action other than to open a sub-menu.
thanks for looking at this.
Tim
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Tue, 05 Jul 2011 05:57:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 8176 <at> debbugs.gnu.org (full text, mbox):
FWIW, this doesn't work under OSX/Nextstep either.
Jan D.
Tim Cross skrev 2011-07-05 02.00:
> (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)))
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Tue, 05 Jul 2011 06:03:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 8176 <at> debbugs.gnu.org (full text, mbox):
No, As I understand it, it only works under Lucid and MS Windows. I
confirmed the Lucid/X side of things and some others confirmed the
windows version.
Is OSX/Nextstep just using GTK+ under the hood or is it a completely
different toolkit?
Tim
On Tue, Jul 5, 2011 at 3:56 PM, Jan Djärv <jan.h.d <at> swipnet.se> wrote:
> FWIW, this doesn't work under OSX/Nextstep either.
>
> Jan D.
>
>
> Tim Cross skrev 2011-07-05 02.00:
>>
>> (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)))
>
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Tue, 05 Jul 2011 08:49:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 8176 <at> debbugs.gnu.org (full text, mbox):
Tim Cross skrev 2011-07-05 08:02:
> No, As I understand it, it only works under Lucid and MS Windows. I
> confirmed the Lucid/X side of things and some others confirmed the
> windows version.
>
> Is OSX/Nextstep just using GTK+ under the hood or is it a completely
> different toolkit?
It is totally different.
Jan D.
>
> Tim
>
> On Tue, Jul 5, 2011 at 3:56 PM, Jan Djärv<jan.h.d <at> swipnet.se> wrote:
>> FWIW, this doesn't work under OSX/Nextstep either.
>>
>> Jan D.
>>
>>
>> Tim Cross skrev 2011-07-05 02.00:
>>>
>>> (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)))
>>
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Tue, 05 Jul 2011 14:15:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 8176 <at> debbugs.gnu.org (full text, mbox):
Tim Cross <theophilusx <at> gmail.com> writes:
> My suggestion would be to add it to the elisp manual, possibly as a
> footnote, in either section 22.17 or possibly 22.17.1. Something along
> the lines that not all GUI toolkits are equal and some features or
> behaviours available in one toolkit may not be available in another.
> For example, GTK will not allow a top level menu button or action,
> while Lucid and NS do.
>
> A tricky part in documenting this is getting consistency of terms. I'm
> not sure if 'top level button or action' is really understood, but
> basically it refers to a menu item on the top level menu bar which
> performs an action other than to open a sub-menu.
Could you suggest a paragraph for 22.17.1 that explains this problem?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Wed, 06 Jul 2011 06:57:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 8176 <at> debbugs.gnu.org (full text, mbox):
On Wed, Jul 6, 2011 at 12:14 AM, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:
> Tim Cross <theophilusx <at> gmail.com> writes:
>
>> My suggestion would be to add it to the elisp manual, possibly as a
>> footnote, in either section 22.17 or possibly 22.17.1. Something along
>> the lines that not all GUI toolkits are equal and some features or
>> behaviours available in one toolkit may not be available in another.
>> For example, GTK will not allow a top level menu button or action,
>> while Lucid and NS do.
>>
>> A tricky part in documenting this is getting consistency of terms. I'm
>> not sure if 'top level button or action' is really understood, but
>> basically it refers to a menu item on the top level menu bar which
>> performs an action other than to open a sub-menu.
>
> Could you suggest a paragraph for 22.17.1 that explains this problem?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog http://lars.ingebrigtsen.no/
>
I will try to draft something in the next few days.
Tim
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Wed, 06 Jul 2011 07:03:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 8176 <at> debbugs.gnu.org (full text, mbox):
On Tue, Jul 5, 2011 at 6:48 PM, Jan D. <jan.h.d <at> swipnet.se> wrote:
> Tim Cross skrev 2011-07-05 08:02:
>>
>> No, As I understand it, it only works under Lucid and MS Windows. I
>> confirmed the Lucid/X side of things and some others confirmed the
>> windows version.
>>
>> Is OSX/Nextstep just using GTK+ under the hood or is it a completely
>> different toolkit?
>
> It is totally different.
>
Good to know. It was suggested that this code failing was evidence of
a bug in GTK+, though I feel it is more evidence of a design decision
wrt GUI philosophy rather than a bug. Having another toolkit which
appears to adopt the same/similar convention of not supporting top
level 'action' or 'buttons' in menus tends to support the design
decision stance rather than seeing it as a bug.
Tim
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Wed, 06 Jul 2011 15:14:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 8176 <at> debbugs.gnu.org (full text, mbox):
Tim Cross <theophilusx <at> gmail.com> writes:
>>> 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)))
I think the situation on W32 is more complex (but I don't have Windows
in front of me to check for sure). I think the above will work if the
command is in a menu-bar menu, but not in a popup menu.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Tue, 12 Jul 2011 03:35:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 8176 <at> debbugs.gnu.org (full text, mbox):
OK, here is my attempt to draft an addition for 12.17.1 which may help
highlight the fact that not all toolkits are equivalent and what is
possible in some toolkits may not be possible in another.
"It should be noted that not all GUI toolkits used by emacs are
equivalent. Some toolkits have specific constraints on how they are
used. These constraints may be due to technical limitations of the
toolkit or they may represent deliberate design choices. It is
possible to implement elisp which works as expected under one toolkit
and either does not work under another or gives unexpected results.
An exmaple of this is the use of menu actions or buttons in a top
level menu-bar. The following code will work in a top level menu when
emacs is built with either the Lucid X toolkit or on MS Windows, but
will fail to work correctly when emacs is built against the GTK+ or
NextStep toolkits. Under these toolkits, the code compiles and the
menu item appears in the top level menu, but clicking on the item
fails to execute the associated action.
(defun menu-action-greet ()
(interactive)
(message "Hello Emacs User!"))
(defun top-level-menu ()
(interactive)
(define-key lisp-interaction-mode-map [menu-bar m]
'(menu-item "Action Button" menu-action-greet)))
On Wed, Jul 6, 2011 at 4:56 PM, Tim Cross <theophilusx <at> gmail.com> wrote:
> On Wed, Jul 6, 2011 at 12:14 AM, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:
>> Tim Cross <theophilusx <at> gmail.com> writes:
>>
>>> My suggestion would be to add it to the elisp manual, possibly as a
>>> footnote, in either section 22.17 or possibly 22.17.1. Something along
>>> the lines that not all GUI toolkits are equal and some features or
>>> behaviours available in one toolkit may not be available in another.
>>> For example, GTK will not allow a top level menu button or action,
>>> while Lucid and NS do.
>>>
>>> A tricky part in documenting this is getting consistency of terms. I'm
>>> not sure if 'top level button or action' is really understood, but
>>> basically it refers to a menu item on the top level menu bar which
>>> performs an action other than to open a sub-menu.
>>
>> Could you suggest a paragraph for 22.17.1 that explains this problem?
>>
>> --
>> (domestic pets only, the antidote for overdose, milk.)
>> bloggy blog http://lars.ingebrigtsen.no/
>>
>
> I will try to draft something in the next few days.
>
> Tim
>
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Fri, 15 Jul 2011 16:34:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 8176 <at> debbugs.gnu.org (full text, mbox):
Tim Cross <theophilusx <at> gmail.com> writes:
> OK, here is my attempt to draft an addition for 12.17.1 which may help
> highlight the fact that not all toolkits are equivalent and what is
> possible in some toolkits may not be possible in another.
What node is this for? That is, what's the name of the node?
> "It should be noted that not all GUI toolkits used by emacs are
> equivalent. Some toolkits have specific constraints on how they are
> used. These constraints may be due to technical limitations of the
> toolkit or they may represent deliberate design choices. It is
> possible to implement elisp which works as expected under one toolkit
> and either does not work under another or gives unexpected results.
>
> An exmaple of this is the use of menu actions or buttons in a top
> level menu-bar. The following code will work in a top level menu when
> emacs is built with either the Lucid X toolkit or on MS Windows, but
> will fail to work correctly when emacs is built against the GTK+ or
> NextStep toolkits. Under these toolkits, the code compiles and the
> menu item appears in the top level menu, but clicking on the item
> fails to execute the associated action.
>
> (defun menu-action-greet ()
> (interactive)
> (message "Hello Emacs User!"))
>
> (defun top-level-menu ()
> (interactive)
> (define-key lisp-interaction-mode-map [menu-bar m]
> '(menu-item "Action Button" menu-action-greet)))
This looks reasonable to me (modulo a few typos :-). A change of this
size needs copyright assignment to the FSF, though. Do you have such
paperwork on file?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Fri, 15 Jul 2011 23:52:04 GMT)
Full text and
rfc822 format available.
Message #41 received at 8176 <at> debbugs.gnu.org (full text, mbox):
On Sat, Jul 16, 2011 at 2:33 AM, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:
> Tim Cross <theophilusx <at> gmail.com> writes:
>
>> OK, here is my attempt to draft an addition for 12.17.1 which may help
>> highlight the fact that not all toolkits are equivalent and what is
>> possible in some toolkits may not be possible in another.
>
> What node is this for? That is, what's the name of the node?
>
22.17.1 Defining Menus
>> "It should be noted that not all GUI toolkits used by emacs are
>> equivalent. Some toolkits have specific constraints on how they are
>> used. These constraints may be due to technical limitations of the
>> toolkit or they may represent deliberate design choices. It is
>> possible to implement elisp which works as expected under one toolkit
>> and either does not work under another or gives unexpected results.
>>
>> An exmaple of this is the use of menu actions or buttons in a top
>> level menu-bar. The following code will work in a top level menu when
>> emacs is built with either the Lucid X toolkit or on MS Windows, but
>> will fail to work correctly when emacs is built against the GTK+ or
>> NextStep toolkits. Under these toolkits, the code compiles and the
>> menu item appears in the top level menu, but clicking on the item
>> fails to execute the associated action.
>>
>> (defun menu-action-greet ()
>> (interactive)
>> (message "Hello Emacs User!"))
>>
>> (defun top-level-menu ()
>> (interactive)
>> (define-key lisp-interaction-mode-map [menu-bar m]
>> '(menu-item "Action Button" menu-action-greet)))
>
> This looks reasonable to me (modulo a few typos :-). A change of this
> size needs copyright assignment to the FSF, though. Do you have such
> paperwork on file?
>
No
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Sat, 16 Jul 2011 17:48:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 8176 <at> debbugs.gnu.org (full text, mbox):
I think this ought to be much shorter; as a side effect it can then be a
"tiny change" that does not need an assignment. Eg something like:
Note that the various toolkits with which you can build Emacs do
not all support the same set of features for menus. Some code works
as expected with one toolkit, but not under another.
For example, menu actions or buttons in a top-level menu-bar.
The following works with the Lucid toolkit or on MS Windows, but
not with GTK or Nextstep, where clicking on the item has no effect.
<code example>
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Sat, 16 Jul 2011 18:06:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 8176 <at> debbugs.gnu.org (full text, mbox):
Glenn Morris <rgm <at> gnu.org> writes:
> I think this ought to be much shorter; as a side effect it can then be a
> "tiny change" that does not need an assignment. Eg something like:
>
> Note that the various toolkits with which you can build Emacs do
> not all support the same set of features for menus. Some code works
> as expected with one toolkit, but not under another.
>
> For example, menu actions or buttons in a top-level menu-bar.
> The following works with the Lucid toolkit or on MS Windows, but
> not with GTK or Nextstep, where clicking on the item has no effect.
>
> <code example>
I've now added this (to a new node).
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Added tag(s) fixed.
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 16 Jul 2011 18:06:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 24.1, send any further explanations to
8176 <at> debbugs.gnu.org and Tim Cross <theophilusx <at> gmail.com>
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 16 Jul 2011 18:06:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Sat, 16 Jul 2011 18:15:02 GMT)
Full text and
rfc822 format available.
Message #54 received at 8176 <at> debbugs.gnu.org (full text, mbox):
Glenn Morris <rgm <at> gnu.org> writes:
> For example, menu actions or buttons in a top-level menu-bar.
This sentence no verb.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8176
; Package
emacs
.
(Sat, 16 Jul 2011 18:33:02 GMT)
Full text and
rfc822 format available.
Message #57 received at 8176 <at> debbugs.gnu.org (full text, mbox):
Andreas Schwab wrote:
>> For example, menu actions or buttons in a top-level menu-bar.
>
> This sentence no verb.
s/For example,/One example is/
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 14 Aug 2011 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 5 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.