Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Aaron Montgomery
On Jan 24, 2013, at 6:46 PM, Chuck Soper wrote: > On 1/24/13 6:30 PM, "Quincey Morris" > 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 >> optional. They may not be optional pre-1

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Chuck Soper
On 1/24/13 6:30 PM, "Quincey Morris" wrote: >On Jan 24, 2013, at 18:11 , Chuck Soper wrote: > >> If I do not implement numberOfRowsInTableView: and >> tableView:objectValueForTableColumn:row: then this error is written to >>the >> console: >> >> *** Illegal NSTableView data source (< MyCustomVi

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Quincey Morris
On Jan 24, 2013, at 18:11 , Chuck Soper 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 numberOfRowsInTabl

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Chuck Soper
On 1/24/13 5:48 PM, "Quincey Morris" wrote: >On Jan 24, 2013, at 17:37 , Graham Cox 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 dat

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Quincey Morris
On Jan 24, 2013, at 17:48 , Quincey Morris 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". ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Quincey Morris
On Jan 24, 2013, at 17:37 , Graham Cox 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 > compulsory proto

Re: Coordinate conversions in CALayer

2013-01-24 Thread Graham Cox
On 25/01/2013, at 11:41 AM, Matt Neuburg 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 rather than acce

Re: NSTableView: bindings with drag and drop

2013-01-24 Thread Graham Cox
On 25/01/2013, at 12:31 PM, Chuck Soper 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 prevent the

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 NSTableViewDataSourc

Re: Coordinate conversions in CALayer

2013-01-24 Thread Matt Neuburg
On Jan 24, 2013, at 3:12 PM, Graham Cox 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 - just bang on the blac

Re: Getting mouse loc in flagsChanges method

2013-01-24 Thread Quincey Morris
On Jan 24, 2013, at 14:44 , Sean McBride 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 'flagsChanged:', the location

Re: Coordinate conversions in CALayer

2013-01-24 Thread Graham Cox
On 25/01/2013, at 12:42 AM, Matt Neuburg 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 second one be

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 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 th

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 "mouseLo

Re: Getting mouse loc in flagsChanges method

2013-01-24 Thread Jens Alfke
On Jan 24, 2013, at 2:03 PM, Steve Mills 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? Keep track of the

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: 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

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 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 th

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: 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 removeTrackin

Re: Multithreading crash in -[NSConditionLock unlockWithCondition:]

2013-01-24 Thread Jerry Krinock
On 2013 Jan 23, at 23:07, Quincey Morris 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 to any foresight on my part, but f

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 removeTrackingArea:tracking

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 usi

Re: NSAttributedString boundingRectWithSize vs. paragraph margins

2013-01-24 Thread Matt Neuburg
On Jan 23, 2013, at 11:01 PM, Kyle Sluder 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 20pt > margin

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 not

Re: Coordinate conversions in CALayer

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

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: Exce

Re: Coordinate conversions in CALayer

2013-01-24 Thread James Montgomerie
On 24 Jan 2013, at 08:19, Graham Cox 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( layer.transform

Re: Hover button and tracking area questions

2013-01-24 Thread Kyle Sluder
On Jan 24, 2013, at 12:30 AM, Kyle Sluder 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. I did so

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 ret

Re: Coordinate conversions in CALayer

2013-01-24 Thread Graham Cox
On 24/01/2013, at 12:42 PM, Quincey Morris 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 set up, even if you have to > abu

Re: Hover button and tracking area questions

2013-01-24 Thread Quincey Morris
On Jan 23, 2013, at 23:49 , Kyle Sluder 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 before instal