• 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
Creating a styles menu like the one in the ruler accessory view of NSLayoutManager...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating a styles menu like the one in the ruler accessory view of NSLayoutManager...


  • Subject: Creating a styles menu like the one in the ruler accessory view of NSLayoutManager...
  • From: Keith Blount <email@hidden>
  • Date: Sun, 27 Jul 2008 08:22:48 -0700 (PDT)

Hi,
I'm fairly sure that this isn't possible without hooking into private methods of NSLayoutManager, but it's worth asking on the off-chance...
In a standard rich text NSTextView, the ruler view has an accessory view provided by NSLayoutManager. This accessory view has several handy controls in it - a styles pop-up menu, a lists pop-up menu, an alignment segmented control and so forth. However, for my own app I'm overriding NSLayoutManager to get rid of this accessory view. Instead, I'm providing a Pages-like format bar; the reason for this is that, given that you can split the editor in my app and therefore have two text views visible, you can also have two accessory views visible which can take up more screen estate than necessary; having the same controls in one bar that affects both text views will take up less space and provide a less cluttered experience. Adding most of the controls to this format bar is straightforward - bold, italic, underline, foreground/background colour, alignment etc are all relatively easy. However, it seems that there is no way of grabbing a list of available
 styles in order to provide a styles menu like the one that appears in the standard accessory view (nor no way of grabbing the lists menu, for that matter). I can just create a button that calls -orderFrontStylesPanel: if necessary, but this will involve more steps for the user (having to go through the sheet to get to the menu), and I'd really just like to provide a list of styles like the one in the standard NSLayoutManager accessory view.
Is there any way of doing this? As I say, from surveying the docs and searching online, I don't think it's possible - I think these lists and how the menus are generated by NSLayoutManager's accessory view are all contained in private methods - but I'd love to discover I'm wrong.
Many thanks in advance and all the best,
Keith



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Web View silently fails
  • Next by Date: Re: Unable to detect a NSRightMouseDown event using a three-button mouse?
  • Previous by thread: Re: Compiler doesn't see instance variable
  • Next by thread: NSGraphicsContext restore crashes my xtension
  • Index(es):
    • Date
    • Thread