• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A strange font situation.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A strange font situation.


  • Subject: Re: A strange font situation.
  • From: Brian Christmas <email@hidden>
  • Date: Sun, 05 Oct 2014 22:24:16 +1100

Thanks Shane

I started out using just theaddItemWithTitle:action:keyEquivalent: ., but had to use a difference of -2 to select the correct menu item.

I thought that the actual menu items should have been one less than the counter, so that item 1 of the font list would be actually item 0 of the menu items. However, in  order to select the correct menu item, say 30 by the counter (font 30), I'm having to subtract 2 from the counter in order to actually select, or tick, the correct actual menu item.

So, for font number 1, I'm actually selecting -1 of the menu items. That seemed illogical, so I assumed that the menu had to be init'ed in order to get a difference of 1, or, in other words, start adding menu items at zero.

Why am I having to use -2? Doesn't seem mathematically correct.

Confusedly  yours

Santa



On 05/10/2014, at 9:45 PM, Shane Stanley <email@hidden> wrote:

I can't follow what your problem is, but you're confusing menus and menu items in your description.

Creating a new menu item using alloc and initWithTitle:action:keyEquivalent: and then adding it to a menu is exactly the same as calling addItemWithTitle:action:keyEquivalent: on the menu. The only point of doing the former would be to be able to set the attributed title without having to keep count, because you'd have a reference to the menu item already. But you're not doing that, so it seems pointless.

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>


_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Re: A strange font situation. (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: A strange font situation.
  • Next by Date: [ANN] Yosemite jumps on Everyday bandwagon
  • Previous by thread: Re: A strange font situation.
  • Next by thread: [ANN] Yosemite jumps on Everyday bandwagon
  • Index(es):
    • Date
    • Thread