Best approach for custom button using layers?

2014-04-06 Thread Graham Cox
I want to make some custom buttons to replace the standard checkbox, and maybe others. I also want to make use of Core Animation layers to animate aspects of these. Looking at the current model of NSControl + NSCell subclasses (in this case NSButton + NSButtonCell), they bring along much

Re: error details in a NSAlert

2014-04-06 Thread Scott Ribe
On Apr 5, 2014, at 7:19 PM, Daniel Luis dos Santos daniel.d...@gmail.com wrote: I want to include the error details and for that I was setting the informativeText field but it doesn’t show up unless its a string literal. That's simply not true, so you're not setting up your string variable

Re: Best approach for custom button using layers?

2014-04-06 Thread edward taffel
i have a number of custom buttons in my app, all derived from NSButton. some do some simple animation (no Core Animation) which i handle in drawRect determined by state. i connect actions in ib, as usual, but with one difference: i handle mouseDown where i change state (open/closed, on/off,

error details in a NSAlert

2014-04-06 Thread Daniel Luis dos Santos
Hello all, I want to display some text indicating a list of errors the user should correct before submitting data. I am using a modal NSAlert in which i set a message with a localised string from a table. I want to include the error details and for that I was setting the informativeText field

Re: error details in a NSAlert

2014-04-06 Thread Daniel Luis dos Santos
Sorry, my mistake String was empty. Conditional that populated it failed. On 06 Apr 2014, at 16:18, Scott Ribe scott_r...@elevated-dev.com wrote: On Apr 5, 2014, at 7:19 PM, Daniel Luis dos Santos daniel.d...@gmail.com wrote: I want to include the error details and for that I was setting

Re: Retain count in non ARC

2014-04-06 Thread Varun Chandramohan
Hi Graham, Thank you for such detailed explanation. I made a few changes except the type check of what NSPropertyListSerialization returns. Ill be adding that soon. Other than that, I wanted you to take a look at the changes I made and let me know if you see any problems. I tested it, at it seems

Re: NSOperation Issues

2014-04-06 Thread Varun Chandramohan
Thanks for the answers guys, I agree that Authorization Services API is not feasible in many cases. However I did make sure that daemon that runs as root has very minimal to do and hopefully well written code that is not exploitable. My only worry was that the code I wrote for root daemon was

Re: Retain count in non ARC

2014-04-06 Thread Graham Cox
On 7 Apr 2014, at 10:35 am, Varun Chandramohan varun.chandramo...@wontok.com wrote: Hi Graham, Thank you for such detailed explanation. I made a few changes except the type check of what NSPropertyListSerialization returns. Ill be adding that soon. Other than that, I wanted you to take a

Re: NSOperation Issues

2014-04-06 Thread Graham Cox
On 7 Apr 2014, at 10:40 am, Varun Chandramohan varun.chandramo...@wontok.com wrote: I was hoping I repeat: Code Defensively. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Retain count in non ARC

2014-04-06 Thread Ken Thomases
On Apr 6, 2014, at 9:18 PM, Graham Cox wrote: On 7 Apr 2014, at 10:35 am, Varun Chandramohan varun.chandramo...@wontok.com wrote: @property (retain) NSArray* contents; Should be: @property (copy) NSArray* contents; @synthesize contents = ivarContents; Having done that you'll now

Re: Retain count in non ARC

2014-04-06 Thread Varun Chandramohan
Thanks guys, really appreciate it. On 7/04/2014 1:25 pm, Ken Thomases k...@codeweavers.com wrote: On Apr 6, 2014, at 9:18 PM, Graham Cox wrote: On 7 Apr 2014, at 10:35 am, Varun Chandramohan varun.chandramo...@wontok.com wrote: @property (retain) NSArray* contents; Should be:

Re: Retain count in non ARC

2014-04-06 Thread Graham Cox
On 7 Apr 2014, at 1:25 pm, Ken Thomases k...@codeweavers.com wrote: Usually, it's better/easier to simply declare the property nonatomic. I thought about mentioning it, but figured it might already sound a bit complicated. Isn't 'nonatomic' the default? If not, I can't actually find the

Re: Retain count in non ARC

2014-04-06 Thread Ben Kennedy
On 06 Apr 2014, at 8:44 pm, Graham Cox graham@bigpond.com wrote: I thought about mentioning it, but figured it might already sound a bit complicated. Isn't 'nonatomic' the default? If not, I can't actually find the documentation about it. Also, if 'atomic' is the default, won't

Re: Retain count in non ARC

2014-04-06 Thread Graham Cox
On 7 Apr 2014, at 1:58 pm, Ben Kennedy b...@zygoat.ca wrote: t is for these two reasons that, from years of conditioning, I can watch my fingers type (nonatomic automatically and as if my magic as soon as I finish typing @property ... Me too, though it's been more to do with the fact

Image scaling property of NSCell/NSButton - where is it?

2014-04-06 Thread Graham Cox
What is actually set when you choose proportionally down or none, etc in IB for image scaling in a button or cell? I can't see any property that takes the type NSImageScaling. I need to create a button programatically with a specific setting here, and I can't see what setter I need to call.

Re: Image scaling property of NSCell/NSButton - where is it?

2014-04-06 Thread Graham Cox
Never mind - I found it, it's in NSButtonCell. --Graham On 7 Apr 2014, at 2:31 pm, Graham Cox graham@bigpond.com wrote: What is actually set when you choose proportionally down or none, etc in IB for image scaling in a button or cell? I can't see any property that takes the type

Re: Image scaling property of NSCell/NSButton - where is it?

2014-04-06 Thread Andy Lee
(Forgot to hit Reply All a minute ago.) I notice both NSImageCell and NSImageView implement setImageScaling:. Both NSSegmentedCell and NSSegmentedControl implement setImageScaling:forSegment:. NSButtonCell implements setImageScaling:, and as it turns out so does NSButton -- but the docs don't

Re: NSOperation Issues

2014-04-06 Thread Joar Wingfors
On 6 apr 2014, at 17:40, Varun Chandramohan varun.chandramo...@wontok.com wrote: My only worry was that the code I wrote for root daemon was using CoreFoundation and later replaced with Foundation APIs as they lot easier to code and maintain. I saw few people warning against that as there

Re: Retain count in non ARC

2014-04-06 Thread Charles Srstka
On Apr 6, 2014, at 11:28 PM, Graham Cox graham@bigpond.com wrote: On 7 Apr 2014, at 1:58 pm, Ben Kennedy b...@zygoat.ca wrote: t is for these two reasons that, from years of conditioning, I can watch my fingers type (nonatomic automatically and as if my magic as soon as I finish