Cannot identify the Menubar button clicked under Mac OS
heather at livecode.com
Wed Feb 26 05:15:21 EST 2020
If this is a screensteps lesson in our portal, please leave a comment on it. We review all comments and action them where necessary.
Customer Services Manager
> On 25 Feb 2020, at 18:48, Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
> Tore Nilsen wrote:
> > The problem here is that when a group is set to behave as a menubar on
> > MacOS, the target becomes the group and not any of the individual
> > buttons. Therefore the script as it is written in the tutorial will
> > not work, since the update of the menu will only happen if the short
> > name of the target is «window». It will work if you remove the
> > encapsulating if-statement.
> Agreed: the engine behavior is fine, the Lesson script is written in a way I've never seen anyone attempt, and will fail.
> Are the Lessons also at Github? Would be nice if someone here has a moment to update that.
> We should also consider adding a menu update example in the User Guide. Most of the Guide's discussion in "Programming Menus and Menu Bars" is pretty good, and there's even a useful example of handling menuPick, but no example for updating via mouseDown.
> > Removing the if-statement will update the content of the «Window» menu
> > regardless of which menu you choose, provided that the script is
> > placed in the group script. This way the user may well choose another
> > menu initially, slide to the «Window» menu and be presented with an
> > updated menu. So, while this may be a bug, the way around it is to
> > write less code. If only all problems could be solved this way.
> Definitely not a bug, at least as far as original intent. Dr. Raney was quite clear when I discussed this with him some 20 years ago that he had no intention of jumping through the hoops that would be needed to try to treat the OS menu bar as a collection of LiveCode buttons.
> A quick change to that one Lesson resolves the issue; extra bonus points if we add that to the User Guide as well.
> Yes, if only everything else was this easy. I'd love to submit a pull request to a Lesson to make it possible to play video on Linux from within LC. :)
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> Ambassador at FourthWorld.com http://www.FourthWorld.com
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode