The fog is lifting a bit and I can see why the card gets the focus. That the focusedObject can change part way through a single line of script is a bit unsettling. The original goal was to access a property of a field to update the menus before they are shown and using the selectedField seems solid.
I don’t know if this is a bug or an observation. If anyone has an opinion about submitting a bug report, I am happy to submit one. Thanks, John On Oct 9, 2014, at 1:02 PM, J. Landman Gay <jac...@hyperactivesw.com> wrote: > On 10/9/2014, 2:10 PM, John wrote: >> While this may be the case in general, when the menubar script is: >> >> on mouseDown >> put the long name of the focusedObject & return & return & the >> focusedObject into field "results" >> end mouseDown >> >> The first part of the put (the long name of the focusedObject) results in a >> card on the main stack being written to the “results” field and the second >> part of the put (the focusedObject) results in the field on the sub stack >> being written to the “results” field. > > It still holds. Menus are buttons, buttons are not focusable on Mac, so > LC reports the card as focused. > > I haven't tracked the problem with two different values in your scripts, but > my first thought was like Mark's: on mouseDown the focus changes to the menu > button. Since buttons can't have focus on Mac, you get the card reported > instead. > > I almost never use focusedObject. The handler worked fine when you checked > the selectedfield, which is how I have always done it too. The discrepancy > you're seeing is interesting (and maybe worth a bug report,) but the > alternative method is easy enough. > > -- > Jacqueline Landman Gay | jac...@hyperactivesw.com > HyperActive Software | http://www.hyperactivesw.com > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode