Re: static analyzers says I'm leaking, I _think_ I'm not

2015-05-08 Thread Daniel Höpfl
On 07.05.2015 20:16, Charles Srstka wrote: > On May 7, 2015, at 6:44 AM, Daniel Höpfl > wrote: >> >> I'd change the code as follows: >> >> // init >> self.cycler = [[[GridCycler alloc] initWithGrid: self] autorelease]; >> >> // alternative init, if you want to bypass the au

Re: static analyzers says I'm leaking, I _think_ I'm not

2015-05-08 Thread Charles Srstka
> On May 8, 2015, at 2:43 AM, Daniel Höpfl wrote: > > a) > @property (assign, nonatomic, readonly) GridCycler *cycler; > > init: > _cycler = [[GridCycler alloc] initWithGrid: self]; > > dealloc: > [_cycler release]; Why are we presenting an assign property as the first (and presumably, default

Re: NSNotification coalescing - which one gets through?

2015-05-08 Thread Jonathan Taylor
Thanks for your replies Seth: >> I am trying to work out whether there are any rules that define which of >> multiple NSNotifications combined using coalescing actually get through to >> the receivers, and preferably a way of controlling that behaviour. This >> becomes relevant if for example t

Re: Where and how do I know a save completed successfully?

2015-05-08 Thread Charles Jenkins
I may have a fundamental misunderstanding of how a document class, a text view, and an undo manager work together. I made these override functions in my Document class:   override func updateChangeCount( change:NSDocumentChangeType ) {     println( "updateChangeCount:" )     super.updateChangeCo

orderFront: 10.10 vs 10.9

2015-05-08 Thread Torsten Curdt
I am staring at this code and don't get why it works fine under 10.10 while under 10.9 it does not. NSScreen *screen = self.window.screen; NSWindow *overlay = [[NSWindow alloc] initWithContentRect:screen.frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered

Re: orderFront: 10.10 vs 10.9

2015-05-08 Thread sqwarqDev
> > On 10.9 I am seeing > > "unlockFocus called too many times. Can't help with the "why", but try putting [button lockFocus]; in that method. Even when there isn't an explicit unlockFocus call, I've had this error message a couple of times and adding an explicit lockFocus cured it. B

Re: orderFront: 10.10 vs 10.9

2015-05-08 Thread Torsten Curdt
Seems like I found the culprit. The drawing code was throwing an exception for a font that couldn't be found. cheers, Torsten On Fri, May 8, 2015 at 4:40 PM, sqwarqDev wrote: > > > > On 10.9 I am seeing > > > > "unlockFocus called too many times. > > > > Can't help with the "why", but try put

Subclassing NSPopUpButton

2015-05-08 Thread Raglan T. Tiger
I have subclassed NSPopUpButton. In the subclass drawRect:dirtyRect is called ... I did this just to check that the subclass is properly implemented. In the subclass keyDown:theEvent is not being called. How does one override this method for an NSPopUPButton subclass? The purpose for overrid

Re: orderFront: 10.10 vs 10.9

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 09:40 AM, sqwarqDev wrote: > Can't help with the "why", but try putting > > [button lockFocus]; > > in that method. Even when there isn't an explicit unlockFocus call, I've > had this error message a couple of times and adding an explicit lockFocus > cured it. Please don

Re: Subclassing NSPopUpButton

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 11:42 AM, Raglan T. Tiger wrote: > I have subclassed NSPopUpButton. In the subclass drawRect:dirtyRect is > called ... I did this just to check that the subclass is properly > implemented. > > In the subclass keyDown:theEvent is not being called. How does one > override

Re: Where and how do I know a save completed successfully?

2015-05-08 Thread Quincey Morris
On May 8, 2015, at 02:46 , Charles Jenkins wrote: > > I may have a fundamental misunderstanding of how a document class, a text > view, and an undo manager work together. It depends a bit on what kind of editing your document can have done to it. > I already tried plugging the document’s undoM

Re: Subclassing NSPopUpButton

2015-05-08 Thread Raglan T. Tiger
> On May 8, 2015, at 10:55 AM, Kyle Sluder wrote: > > In that case, the menu is running the runloop in event-tracking mode and > pulling events for its own purpose. I create an NSMenu and populate it with NSMenuItem s and then set this menu to the NSPopUpButton. Would it make sense to use a

Re: Subclassing NSPopUpButton

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 12:41 PM, Raglan T. Tiger wrote: > > On May 8, 2015, at 10:55 AM, Kyle Sluder wrote: > > > > In that case, the menu is running the runloop in event-tracking mode and > > pulling events for its own purpose. > > > I create an NSMenu and populate it with NSMenuItem s and

Limiting GCD concurrent queues

2015-05-08 Thread Carl Hoefs
OS X 10.10.3 Xcode 6.3.1 I need to limit a GCD concurrent queue to a specific number of concurrently executing tasks (less than the number of cores available). The only way I can get this to work is by adding "external plumbing" in the form of semaphores to the dispatch invocation: dispatch

Re: Rotate a standard Cocoa control?

2015-05-08 Thread Robert Martin
Graham, Thanks so much for posting this. I’ve always wondered how to go about doing this kind of thing, but never had the actual need in a project to prod me to figure it out. Your app and code are terrific at making things clear. Thanks, Rob > On May 7, 2015, at 11:54 PM, Graham Cox wrote:

Re: Limiting GCD concurrent queues

2015-05-08 Thread Ken Thomases
On May 8, 2015, at 1:51 PM, Carl Hoefs wrote: > I need to limit a GCD concurrent queue to a specific number of concurrently > executing tasks (less than the number of cores available). > I was hoping an API like the following might be lurking around somewhere: > >gcdConcQueue = dispatch_qu

Re: Limiting GCD concurrent queues

2015-05-08 Thread Carl Hoefs
> On May 8, 2015, at 1:19 PM, Ken Thomases wrote: > > You should use an NSOperationQueue. You can set its > maxConcurrentOperationCount. You can add blocks to it using > -addOperationWithBlock: or by instantiating NSBlockOperation objects and > adding those with -addOperation:. Awesome, th

Re: Limiting GCD concurrent queues

2015-05-08 Thread Graham Cox
> On 9 May 2015, at 6:19 am, Ken Thomases wrote: > > You should use an NSOperationQueue. You can set its > maxConcurrentOperationCount. You can add blocks to it using > -addOperationWithBlock: or by instantiating NSBlockOperation objects and > adding those with -addOperation:. Though watc

Re: Rotate a standard Cocoa control?

2015-05-08 Thread Graham Cox
> On 9 May 2015, at 6:08 am, Robert Martin wrote: > > Graham, > > Thanks so much for posting this. I’ve always wondered how to go about doing > this kind of thing, but never had the actual need in a project to prod me to > figure it out. Your app and code are terrific at making things clear.

Re: Where and how do I know a save completed successfully?

2015-05-08 Thread Charles Jenkins
On May 8, 2015 at 1:09:01 PM, Quincey Morris (quinceymor...@rivergatesoftware.com) wrote: In this case, the text view should probably use the document undo manager, though you may have to do extra work to coordinate its use with your document’s needs. To configure it, you should tell the text vi

Re: Where and how do I know a save completed successfully?

2015-05-08 Thread Quincey Morris
On May 8, 2015, at 17:50 , Charles Jenkins wrote: > > I tell the text view its delegate is my Document instance as soon as possible > in windowControllerDidLoadNib: I don’t know the timing offhand, but it’s possible that the text view looks for its undo manager earlier. I’d suggest you hook u

Re: Rotate a standard Cocoa control?

2015-05-08 Thread Jerry Krinock
Graham, from one who has been using your code since MacZoop, I say thank you AGAIN :) After using Apple’s NSSlider in circular style, I discovered other issues in addition to the two mentioned in my original post… - NSSlider has only one size. - NSSlider requires the eyesight and dexterity of

Re: Rotate a standard Cocoa control?

2015-05-08 Thread Steve Mills
> On May 9, 2015, at 00:22:12, Jerry Krinock wrote: > > Graham, from one who has been using your code since MacZoop, I say thank you > AGAIN :) > > After using Apple’s NSSlider in circular style, I discovered other issues in > addition to the two mentioned in my original post… > > - NSSlider