Re: Attributed strings - and bounding rects

2017-03-03 Thread Alex Zavatone
Isn't this where we set the mask so that the image is not bound by the rect? On Mar 3, 2017, at 7:18 AM, Peter Hudson wrote: > Hi All > > I have done the following to try to determine the rect required to draw an > attributed string( and thus the height of a row in a table view - on MacOS )

Attributed strings - and bounding rects

2017-03-03 Thread Peter Hudson
Thanks to both of you for helpful code. I’m still not out of the wood yet though. Insofar as I can now determine the size of the rect to hold the attributed string, I can’t write it to the cell correctly. This is what i do :- // aString is a preprepared attributed string // Determine the

Re: I think I messed up the undo-count during load

2017-03-03 Thread Daryle Walker
Nearly a day later, and the bug doesn’t show up now. I hate Heisen-bugs. But is there a timing issue on how “NSManagedObjectContext.save” works? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list

Adding a watchOS complication to an existing project?

2017-03-03 Thread Eric E. Dolecki
Everything I've seen shows adding the complication on project creation. How does one go about adding it to a project later on? I have my watch app right where I want it, but I didn't think I would need a complication. Until today. Thanks! ___ Cocoa-dev

Re: UTI and/or bundle-IDs with small letters

2017-03-03 Thread Kevin Hardman
FWIW: It is my understanding that UTIs are derived from domain names as defined in RFC 1035 (relevant portion quoted below). Nevertheless, as already quoted in a previous post it is best to use the “Testing for Equality and Conformance” APIs or the NSWorkspace’s function type(String,

Re: Attributed strings - and bounding rects

2017-03-03 Thread Peter Hudson
Thanks for that piece of code - it works a treat and produces a sensible height ! The only problem is that my attributed string does not draw correctly . The string has a number of new lines ( \n ) in it and would need to be wrapped into the space. It all works perfectly in objective-C ! But,

Issue with addTitlebarAccessoryViewController on 10.10

2017-03-03 Thread Mark Allan
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

Re: Attributed strings - and bounding rects

2017-03-03 Thread Jonathan Mitchell
Hi I needed to do this for my pdf builder implementation: Using the NSLayoutManager directly gives the best level of control. https://github.com/ThesaurusSoftware/PDFPageBuilder/blob/master/PDFPageBuilder/TSPageTextItem.m#L95 NSRect boundingRect = self.containerRect; // if no

Re: Attributed strings - and bounding rects

2017-03-03 Thread Igor Ranieri
Hi Peter. Have you tried also passing `usesLineFragmentOrigin` as one of the options? It works here. Here’s some code I’m currently using to achieve a similar effect: let sizeLimit = CGSize(width: 80.0, height: CGFloat.greatestFiniteMagnitude) let size = attrString.boundingRect(with:

Attributed strings - and bounding rects

2017-03-03 Thread Peter Hudson
Hi All I have done the following to try to determine the rect required to draw an attributed string( and thus the height of a row in a table view - on MacOS ) I am trying to constrain my column width to 60 - and let the possible height of the row be a max of 1000. let aString =

Re: KVC Validation w/ custom Formatter not working

2017-03-03 Thread Luc Van Bogaert
The formatting with the custom formatter is working. Due to a misunderstanding on my part, I was incorrectly assuming that the validation method was not called. Actually, that is only the case when the formatter returns "false" from its getObjectValue(:for:errorDescription:) method, which I