• 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: Issue with addTitlebarAccessoryViewController on 10.10
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue with addTitlebarAccessoryViewController on 10.10


  • Subject: Re: Issue with addTitlebarAccessoryViewController on 10.10
  • From: Mark Allan <email@hidden>
  • Date: Mon, 06 Mar 2017 12:21:57 +0000

> On 5 Mar 2017, at 10:35 pm, Kyle Sluder <email@hidden> wrote:
>
> On Fri, Mar 3, 2017, at 08:39 AM, Mark Allan wrote:
>> Hi all,
>>
>> I've got an NSWindow which has an NSToolbar added programmatically. The
>> window does not use a shared title/toolbar.  I now want to add a little
>> bit of text/button to the window's titlebar, so for OS X 10.6 to 10.9,
>> I'm doing it the old way playing around with NSWindow subviews, which
>> works fine.
>>
>> On versions 10.10+ I'm using addTitlebarAccessoryViewController which
>> works great on 10.11 and 10.12, but for some reason it shifts the toolbar
>> buttons out of position on 10.10.
>>
>> Judging by the AppKit release notes, this is a known issue which was
>> fixed in 10.11, and also by linking on 10.11
>>
>>> For applications linked on 10.11 and higher, a NSTitlebarAccessoryViewController with the layoutAttribute set to NSLayoutAttributeRight will no longer right indent toolbar items, unless the titleVisibility == NSWindowTitleHidden. This allows placing a view/button/textfield (etc) above the toolbar without right indenting the toolbar. However, for the NSWindowTitleHidden, there is still a desire to indent the toolbar on the right to leave space for the accessory view.
>>
>> I'm currently building on macOS 10.12 (with target of 10.6) but the issue
>> still shows up for users on OS X 10.11, even with the viewcontroller's
>> layoutAttribute = NSLayoutAttributeRight.
>>
>> Does anyone know of a fix or workaround I could use please?
>
> Is it possible to reproduce this in a sample app? This should be
> behaving as documented in the release notes.
>
> --Kyle Sluder

Hi Kyle,

Yes, I've just moved all the relevant code in to a new sample app and it behaves the same way.  Below is a link to the code and a three screenshots showing how it appears on 10.6, 10.10 and 10.11.

https://www.dropbox.com/s/1adygl9r8mhfn0s/TestApp_TitlebarAccesoryTrouble.zip?dl=0 <https://www.dropbox.com/s/1adygl9r8mhfn0s/TestApp_TitlebarAccesoryTrouble.zip?dl=0>

Many thanks
Mark

_______________________________________________

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


References: 
 >Issue with addTitlebarAccessoryViewController on 10.10 (From: Mark Allan <email@hidden>)
 >Re: Issue with addTitlebarAccessoryViewController on 10.10 (From: Kyle Sluder <email@hidden>)

  • Prev by Date: boundingRectForGlyphRange is very inaccurate
  • Next by Date: Binding NSTextField to an array
  • Previous by thread: Re: Issue with addTitlebarAccessoryViewController on 10.10
  • Next by thread: Adding a watchOS complication to an existing project?
  • Index(es):
    • Date
    • Thread