Re: updating NSTextField before spinner animates

2014-11-12 Thread Graham Cox
The right solution is, as Fritz mentioned, to design your code to work asynchronously. But for a quick-and-dirty solution to force a text field (or any other UI) to show a change straight away is to include the redraw directly yourself. This should not be done from a thread other than main howev

Re: updating NSTextField before spinner animates

2014-11-12 Thread Fritz Anderson
On 12 Nov 2014, at 2:58 AM, sqwarqDev wrote: > Thanks for this Fritz. I think I get it. I need to get a clearer idea of how > the run loop works. This isn't the first time I've been confused about why a > line doesn't appear to return the result I expect before the next line > executes. I supp

Re: updating NSTextField before spinner animates

2014-11-12 Thread sqwarqDev
> On 11 Nov 2014, at 23:01, Fritz Anderson wrote: > -needsDisplay schedules a view’s -drawRect: for the next pass through the > runloop. You’re putting your process to sleep at the OS level, so the runloop > is suspended along with everything else. > > What you posted is evidently a minimal ca

Re: updating NSTextField before spinner animates

2014-11-11 Thread Fritz Anderson
On 11 Nov 2014, at 4:15 AM, sqwarqDev wrote: > I have an NSTextView, whose string I want to update while I wait for another > method to complete. Since this method is going to take around 10-30 seconds, > I'm displaying a spinner progress indicator. > > However, I want the text field to updat

updating NSTextField before spinner animates

2014-11-11 Thread sqwarqDev
Using Xcode Version 6.1 (6A1052d) on the latest developer build of Yosemite. I'm confused as to whether this is a bug, or if I'm just doing something wrong. I have an NSTextView, whose string I want to update while I wait for another method to complete. Since this method is going to take aroun