|
From: | Riccardo Mottola |
Subject: | Re: issue with auto-enable of Menus |
Date: | Mon, 13 Nov 2017 09:57:57 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 |
Hi Wolfgang, Fred, Wolfgang Lux wrote:
if (action == @selector(copy:) || action == @selector(cut:) || action == @selector(delete:))you must use sel_isEqual to compare selectors in portable code, i.e., if (sel_isEqual(action, @selector(copy:)) || sel_isEqual(action, @selector(cut:)) || sel_isEqual(action, @selector(delete:)) While sel_isEqual is just an alias for == on Apple's runtime (and the GNUstep runtime, I assume), this need not be the case for other runtimes. In particular, for the old GNU runtime sel_isEqual is not equivalent to ==, as you've observed.
that was it! I did run on gcc5 with the gcc runtime.What was confusing was that "some" menus were enabled, some not! I was fearing that auto-enable was working for some menus and other not, an issue in the responder chain, while it was actually much simpler.
Thanks, RiccardoPS: this leads to a more usable editing in Graphos: quite nice, something I had to do years ago!
[Prev in Thread] | Current Thread | [Next in Thread] |