Re: Trap mouse and keyboard events

2012-06-25 Thread Graham Cox
On 25/06/2012, at 3:56 PM, Abhijeet Singh wrote: Hi,I want to perform some action in my application whenever user presses any key on keyboard or uses the mouse. How can I trap these events... RTFM? --Graham ___ Cocoa-dev mailing list

Re: Why do we use -fobjc-arc instead of removing code with #define?

2012-06-25 Thread Uli Kusterer
On 24.06.2012, at 03:41, Dave DeLong wrote: #define DD_RETAIN(_o) (_o) #define DD_RELEASE(_o) #define DD_AUTORELEASE(_o) (_o) IIRC GNUstep already has standard-defined RETAIN() macros etc. (When they added their garbage collector, way before Apple made their attempt at one) Might be worth

Re: Why do we use -fobjc-arc instead of removing code with #define?

2012-06-25 Thread Uli Kusterer
On 24.06.2012, at 05:55, Jerry Krinock wrote: Why didn't Apple do the same thing for ARC? Because the whole point of ARC is that you don't have to write retain/release calls, and thus can't make mistakes in them. Since, once compiled, ARC code is pretty much identical to manually managed code

CALayer coordinates question

2012-06-25 Thread Vincent Habchi
Hi there, briefly speaking, I have a sublayer that I draw using various Bezier paths and other goodies (code generated by PaintCode™). No matter where I set the frame of my sublayer, or what I do with bounds, the drawing always appear in the lower left corner of the parent NSView. Is that

Re: CALayer coordinates question

2012-06-25 Thread David Duncan
On Jun 25, 2012, at 5:12 AM, Vincent Habchi wrote: Hi there, briefly speaking, I have a sublayer that I draw using various Bezier paths and other goodies (code generated by PaintCode™). No matter where I set the frame of my sublayer, or what I do with bounds, the drawing always appear in

Re: willDisplayOutlineCell of view-based NSOutlineView is not called

2012-06-25 Thread Corbin Dunn
You really want to call [super didAddSubview:] in that code snippet. corbin On Jun 23, 2012, at 2:29 PM, Nava Carmon ncar...@mac.com wrote: Just for those who need to customize their outline view disclosure arrow: Here's the answer from SO, that worked perfectly for me.

notification upon restoring a version

2012-06-25 Thread qvacua
Hi, are there notifications or delegate methods of NSDocument (or NSDocumentController) which are called when the user invokes Versions and/or restores a version of a document? Thanks in advance and best, Tae ___ Cocoa-dev mailing list

Re: notification upon restoring a version

2012-06-25 Thread Kevin Perry
When the user enters or exits Versions, there are notifications sent out called NSWindowWillEnterVersionBrowserNotification, NSWindowDidEnterVersionBrowserNotification, etc. (see NSWindow.h) You will know when a user chooses Restore, because the NSDocument instance will be sent

Re: Why do we use -fobjc-arc instead of removing code with #define?

2012-06-25 Thread Greg Parker
On Jun 23, 2012, at 8:55 PM, Jerry Krinock je...@ieee.org wrote: But now I wonder why Apple did not do this, as they did with Garbage Collection. Methods -retain, -release, and -autorelease are no-ops when GC is on. Why didn't Apple do the same thing for ARC? Objective-C garbage

Re: Trap mouse and keyboard events

2012-06-25 Thread Richard Somers
On Jun 24, 2012, at 11:56 PM, Abhijeet Singh wrote: I want to perform some action in my application whenever user presses any key on keyboard or uses the mouse. How can I trap these events. One way to do this would be to subclass NSApplication and override sendEvent:. The documentation

Re: Why do we use -fobjc-arc instead of removing code with #define?

2012-06-25 Thread Graham Cox
On 26/06/2012, at 7:42 AM, Greg Parker wrote: We recommend each file be written for either one or the other, with no attempt to be ARC-agnostic. Does this imply that ARC can be adopted gradually? For example, I have a large project that uses manual memory management. If I add a new class

Re: Why do we use -fobjc-arc instead of removing code with #define?

2012-06-25 Thread Dave DeLong
Yes, you can do this, because ARC is a compile-time option and files are compiled individually. To compile with ARC, you'll need to use the -fobjc-arc flag. Cheers, Dave Sent from Jane On Jun 25, 2012, at 6:20 PM, Graham Cox graham@bigpond.com wrote: On 26/06/2012, at 7:42 AM, Greg