Re: Hover button and tracking area questions

2013-01-24 Thread Quincey Morris
On Jan 23, 2013, at 23:49 , Kyle Sluder k...@ksluder.com wrote: There's no need to release and reinstall your tracking areas every time you get -updateTrackingAreas I agree with this part. Regardless, you've failed to implement the pattern properly. You're never removing the tracking areas

Re: Coordinate conversions in CALayer

2013-01-24 Thread Graham Cox
On 24/01/2013, at 12:42 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: This sort of thing drives me nuts too. You have to simplify the problem. 1. In the scenario where bounds.origin is (0,0) and the anchor point is (0,0) -- which should be be a very ordinary scenario to

Re: Hover button and tracking area questions

2013-01-24 Thread Kyle Sluder
On Thu, Jan 24, 2013, at 12:03 AM, Quincey Morris wrote: It should be pretty obvious why this is causing you to crash when messaging zombie objects. But not this, though it was my first thought, too. However, it would be a bug in the frameworks if 'addTrackingArea:' didn't retain the

Re: Hover button and tracking area questions

2013-01-24 Thread Kyle Sluder
On Jan 24, 2013, at 12:30 AM, Kyle Sluder k...@ksluder.com wrote: But considering that the API is intended to be used to create and install tracking areas on objects that are potentially different from their owner, it seems sensible that -addTrackingArea: might not retain the tracking area.

Re: Coordinate conversions in CALayer

2013-01-24 Thread James Montgomerie
On 24 Jan 2013, at 08:19, Graham Cox graham@bigpond.com wrote: I've made some progress, in that I managed to make the two code snippets work the same, by changing this line: tfm = CGAffineTransformConcat( tfm, layer.transform ); to this: tfm = CGAffineTransformConcat(

Re: Hover button and tracking area questions

2013-01-24 Thread Nick Rogers
Hi, The code that I pasted was going thru change. In the original copy, I was removing tracking area before adding the new. So now my thinking goes that I shouldn't have added tracking areas after the initial one, at least I am now doing that and hoping it not to crash. The exception was:

Re: Coordinate conversions in CALayer

2013-01-24 Thread Matt Neuburg
Date: Thu, 24 Jan 2013 12:01:28 +1100 From: Graham Cox graham@bigpond.com To: cocoa-dev@lists.apple.com Dev cocoa-dev@lists.apple.com Subject: Re: Coordinate conversions in CALayer Boiling down my problem to its bare essentials, why are these two bits of code not equivalent?

Re: Hover button and tracking area questions

2013-01-24 Thread Markus Spoettl
On 1/24/13 12:06 PM, Nick Rogers wrote: The code that I pasted was going thru change. In the original copy, I was removing tracking area before adding the new. So now my thinking goes that I shouldn't have added tracking areas after the initial one, at least I am now doing that and hoping it

Re: NSAttributedString boundingRectWithSize vs. paragraph margins

2013-01-24 Thread Matt Neuburg
On Jan 23, 2013, at 11:01 PM, Kyle Sluder k...@ksluder.com wrote: It may be that the height is right despite the narrowed width, but since the narrowed width is unexpected, it would be nice to be assured of this. m. Why is the narrowed width unexpected? You told the text system to use

Re: NSAttributedString boundingRectWithSize vs. paragraph margins

2013-01-24 Thread Matt Neuburg
UILabel sizeToFit shows the same problem. If I start with a tall UILabel and set its attributedText to my string, and then tell the label to sizeToFit, the label gets narrower and the text no longer fits. This is because the sizeToFit algorithm is ignoring the margins (in fact it is probably

Re: Hover button and tracking area questions

2013-01-24 Thread Nick Rogers
Hi, Thanks for the reply. The code for HoverButton class is almost same as I posted in the first email with the exception that in the following method I was removing trackingArea before releasing it. - (void)updateTrackingAreas { if (trackingArea) { [self

Re: Multithreading crash in -[NSConditionLock unlockWithCondition:]

2013-01-24 Thread Jerry Krinock
On 2013 Jan 23, at 23:07, Quincey Morris quinceymor...@rivergatesoftware.com wrote: What's the source code line that invokes 'unlockWithCondition:'? If it's sending that message to a local variable, then the ARC version is safe As it turns out, it was sending to a local variable, not due

Re: Hover button and tracking area questions

2013-01-24 Thread Markus Spoettl
On 1/24/13 3:50 PM, Nick Rogers wrote: The code for HoverButton class is almost same as I posted in the first email with the exception that in the following method I was removing trackingArea before releasing it. - (void)updateTrackingAreas { if (trackingArea) { [self

Re: Hover button and tracking area questions

2013-01-24 Thread Kyle Sluder
On Thu, Jan 24, 2013, at 07:05 AM, Markus Spoettl wrote: Maybe the superclass (NSButton) isn't smart enough to understand the someone else may change the tracking areas and does something nasty with it (like assuming all tracking areas currently added are owned too). What if you remove

Re: NSAttributedString boundingRectWithSize vs. paragraph margins

2013-01-24 Thread Kyle Sluder
On Thu, Jan 24, 2013, at 06:14 AM, Matt Neuburg wrote: On Jan 23, 2013, at 11:01 PM, Kyle Sluder k...@ksluder.com wrote: It may be that the height is right despite the narrowed width, but since the narrowed width is unexpected, it would be nice to be assured of this. m. Why is

Re: NSAttributedString boundingRectWithSize vs. paragraph margins

2013-01-24 Thread Kyle Sluder
On Thu, Jan 24, 2013, at 11:52 AM, Kyle Sluder wrote: I expect this method to tell me the size of a rectangle (e.g. a bitmap context) such that if I draw my attributed string into that rectangle, it will all fit. When I say all I mean all, including the margins. Considering the method is

Getting mouse loc in flagsChanges method

2013-01-24 Thread Steve Mills
The docs says that [NSEvent locationInWindow] is undefined for this method. I need to change the cursor when certain modifiers are pressed or released (hand, zoom, etc) and the mouse is inside my view subclass. Any ideas? -- Steve Mills office: 952-818-3871 home: 952-401-6255 cell: 612-803-6157

Re: Getting mouse loc in flagsChanges method

2013-01-24 Thread Jens Alfke
On Jan 24, 2013, at 2:03 PM, Steve Mills smi...@makemusic.com wrote: The docs says that [NSEvent locationInWindow] is undefined for this method. I need to change the cursor when certain modifiers are pressed or released (hand, zoom, etc) and the mouse is inside my view subclass. Any ideas?

Re: Getting mouse loc in flagsChanges method

2013-01-24 Thread Sean McBride
On Thu, 24 Jan 2013 16:03:25 -0600, Steve Mills said: The docs says that [NSEvent locationInWindow] is undefined for this method. I need to change the cursor when certain modifiers are pressed or released (hand, zoom, etc) and the mouse is inside my view subclass. Any ideas? Consider

Re: Getting mouse loc in flagsChanges method

2013-01-24 Thread Kyle Sluder
On Thu, Jan 24, 2013, at 02:12 PM, Jens Alfke wrote: On Jan 24, 2013, at 2:03 PM, Steve Mills smi...@makemusic.com wrote: The docs says that [NSEvent locationInWindow] is undefined for this method. I need to change the cursor when certain modifiers are pressed or released (hand, zoom,

Re: Coordinate conversions in CALayer

2013-01-24 Thread Graham Cox
On 25/01/2013, at 12:42 AM, Matt Neuburg m...@tidbits.com wrote: They are not equivalent because the first one starts with CGContextTranslateCTM but the second one starts with CGAffineTransformMakeTranslation. In other words, the first one begins by translating the current transform. The

Re: Getting mouse loc in flagsChanges method

2013-01-24 Thread Quincey Morris
On Jan 24, 2013, at 14:44 , Sean McBride s...@rogue-research.com wrote: Consider mouseLocationOutsideOfEventStream. This is not a completely correct solution. As its name indicates, this mouse location isn't synchronized with the event stream. That is, at the time the app is handling

Re: Coordinate conversions in CALayer

2013-01-24 Thread Matt Neuburg
On Jan 24, 2013, at 3:12 PM, Graham Cox graham@bigpond.com wrote: stumbled upon the right result which correctly transforms down through a series of nested layers and back up again. Don't ask me how it works or I'll start to whimper It sounds like you sometimes program the way I do -

NSTableView: bindings with drag and drop

2013-01-24 Thread Chuck Soper
When I use bindings for NSTableView and implement drag and drop, an Illegal NSTableView data source error is written to the console. This is because I use NSTableViewDataSource methods to implement drag and drop. I'm able to prevent the error message if I declare these bogus NSTableViewDataSource

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Graham Cox
On 25/01/2013, at 12:31 PM, Chuck Soper chu...@veladg.com wrote: When I use bindings for NSTableView and implement drag and drop, an Illegal NSTableView data source error is written to the console. This is because I use NSTableViewDataSource methods to implement drag and drop. I'm able to

Re: Coordinate conversions in CALayer

2013-01-24 Thread Graham Cox
On 25/01/2013, at 11:41 AM, Matt Neuburg m...@tidbits.com wrote: It sounds like you sometimes program the way I do - just bang on the black box until the right thing comes out the other end, then stop. :) m. Well in this case, yes. I hate that - I much prefer to have a good understanding

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Quincey Morris
On Jan 24, 2013, at 17:37 , Graham Cox graham@bigpond.com wrote: If the table view has a dataSource assigned, it has to be legal, which means it must implement those two methods. The fact that, with bindings, they may not ever be called is irrelevant. The dataSource must conform to the

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Quincey Morris
On Jan 24, 2013, at 17:48 , Quincey Morris quinceymor...@rivergatesoftware.com wrote: NSTableViewDelegate Ugh, I meant NSTableViewDataSource. I'm at a 100% hit rate for non-misspelled typos in the last couple of days. Ditto well-reasonable. ___

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Chuck Soper
On 1/24/13 5:48 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jan 24, 2013, at 17:37 , Graham Cox graham@bigpond.com wrote: If the table view has a dataSource assigned, it has to be legal, which means it must implement those two methods. The fact that, with bindings, they

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Quincey Morris
On Jan 24, 2013, at 18:11 , Chuck Soper chu...@veladg.com wrote: If I do not implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row: then this error is written to the console: *** Illegal NSTableView data source ( MyCustomView: 0x1019ab7b0). Must implement

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Chuck Soper
On 1/24/13 6:30 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jan 24, 2013, at 18:11 , Chuck Soper chu...@veladg.com wrote: If I do not implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row: then this error is written to the console: *** Illegal

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Aaron Montgomery
On Jan 24, 2013, at 6:46 PM, Chuck Soper chu...@veladg.com wrote: On 1/24/13 6:30 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: It's clearly documented that they're optional in your situation, and the documentation is 10.7-vintage. The 10.8 SDK header file also says they're