Re: NSOperation - Update UI with delegate or in a Controller with oberseValueForKeyPath:

2014-04-24 Thread Gilles Celli
Ok thank you very much for the clarification, it's much clearer now for me. So I will stick with KVO, as you wrote. Cheers, Gilles On 24 avr. 2014, at 19:38, Quincey Morris wrote: > On Apr 24, 2014, at 06:47 , Gilles Celli wrote: > >> 1. With KVO in a Controller obje

NSOperation - Update UI with delegate or in a Controller with oberseValueForKeyPath:

2014-04-24 Thread Gilles Celli
Hello Cocoa-Meisters, My Document-based OS X program is parsing huge ASCII data files in an NSOperationQueue, and then displays the data in a graph. It works, however I've seen 2 different approaches to update the User-Interface (UI) after the NSOperation has finished (please check code below)

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-02-04 Thread Gilles Celli
08:05 AM, Gilles Celli wrote: >> >> I have some deleted threads though with "uncommitted CATransaction" on OS >> X 10.8.2 only (but not on OS X 10.7.x) to display the graphs… >> but that could be a bug of the graphs framework…need to check…. > > This usuall

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-02-04 Thread Gilles Celli
ote: > > On 31 Jan 2013, at 15:06, Gilles Celli wrote: > >> Hmm well Mike you were right! >> >> I was too enthusiastic yesterday by claiming that I fixed my Open Panel >> problem… I tried it here on my old Mac Mini with OS X 10.7 and the Open Panel >> stil

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-31 Thread Gilles Celli
t you know how it goes….I'm getting mad :-0 On 31 Jan 2013, at 01:33, Mike Abdullah wrote: > > On 30 Jan 2013, at 21:29, Gilles Celli wrote: > >> Well I think I found it: now the Open Panel disappears when opening large >> files in my document-based app. >> Now

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-30 Thread Gilles Celli
12:41, Mike Abdullah wrote: > > On 29 Jan 2013, at 16:18, Gilles Celli wrote: > >> I looked a little bit today here with my application, and the term >> unresponsive for the Open Panel is not appropriate: >> it should be "stays open" when reading /process

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-30 Thread Gilles Celli
at a later time… I'll let you know ASAP when I'm done…hopefully not in several days or month(s) ;-) On 29 Jan 2013, at 22:03, Quincey Morris wrote: > On Jan 29, 2013, at 12:00 , Gilles Celli wrote: > >> Ok, sounds good...but what bothers me is that I'm using an NSDo

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-29 Thread Gilles Celli
rote: > On Jan 29, 2013, at 08:18 , Gilles Celli wrote: > >> Simply put, the Open Panel should be closed, but it stays open until the >> data file has been processed and the data displayed as a graph. > > If you're using one of the 'begin…completionHandl

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-29 Thread Gilles Celli
27;t find anything about it… Any help is as always greatly appreciated :-) On 28 Jan 2013, at 18:44, Mike Abdullah wrote: > > On 28 Jan 2013, at 16:46, Gilles Celli wrote: > >> Please don't be scared ;-) >> Well I'm little bit in a hurry … will look more cl

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Gilles Celli
013, at 17:13, Mike Abdullah wrote: > > On 28 Jan 2013, at 15:25, Gilles Celli wrote: > >> Thanks Mike, >> >> I just looked with Instruments and well yes to process the data my app uses >> NSScanner a lot to extract date/time with its corresponding

Re: NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Gilles Celli
hould I put the data processing in a dispatch_sync queue in the WindowController or in NSDocument's makeWindowController ? Gilles On 28 Jan 2013, at 14:21, Mike Abdullah wrote: > > On 28 Jan 2013, at 13:18, Gilles Celli wrote: > >> Hi, >> >> I've th

NSDocument's Open File Panel unresponsive when opening large file from disc

2013-01-28 Thread Gilles Celli
Hi, I've the following problem on OS X 10.6 and later: My document based app (reads some small and big (150MB or more) ASCII files to process data, I'm using the method: readFromURL:ofType:error: and returning canConcurrentlyReadDocumentsOfType: to YES. When trying to open a bigger file the "O

Re: TextField not updated in a sheet for document-based Cocoa app

2012-06-13 Thread Gilles Celli
Graham, Following your suggestions I tried with [[NSOperationQueue mainQueue] addOperationWithBlock: to update the textField while processing filesbut with less or more success... While I put [NSApp beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: inside [[NSOperationQu

Re: TextField not updated in a sheet for document-based Cocoa app

2012-06-12 Thread Gilles Celli
Graham, Thanks for your fast response. I'll look at this ASAP, and will let you know how it goes :-) Cheers, Gilles On Jun 12, 2012, at 2:27 AM, Graham Cox wrote: > > On 12/06/2012, at 12:29 AM, Gilles Celli wrote: > >> the sheet is properly displayed (with its TextField

TextField not updated in a sheet for document-based Cocoa app

2012-06-11 Thread Gilles Celli
Hi, I've written a document-based Cocoa application on OS X which displays graphs visually by opening an ASCII file. My program has also the possibility to append ASCII files to the current document: when a user chooses the "Append …" menu in the File Menu a sheet opens with a NSTextField appen

Re: NSDocument app: combine multiple file contents to open one window instead of multiple windows

2012-04-06 Thread Gilles Celli
vantage of using NSDocument are multiple, and mainly printing to PDF works great etc. so it should be possible (since it's possible on Windows XP ;-) Gilles On Apr 6, 2012, at 4:59 PM, Kyle Sluder wrote: > On Apr 6, 2012, at 7:39 AM, Gilles Celli wrote: > >> It works and if

NSDocument app: combine multiple file contents to open one window instead of multiple windows

2012-04-06 Thread Gilles Celli
Hi all, My document-based application on Mac OS X reads ASCII data file to draw graphs based on date/time and y-values. It reads the file contents by overriding readFromURL:ofType:error: ... NSString *fileContents = [[NSString alloc] initWithContentsOfURL:absoluteURL

Re: Convert PDF CGContextRef to NSView for hi-res printing

2012-03-09 Thread Gilles Celli
illes On Mar 5, 2012, at 11:21 PM, Wim Lewis wrote: > > On 5 Mar 2012, at 12:13 PM, Gilles Celli wrote: >> I'm stuck on a problem on how to print high resolution graphs on Mac OS X, >> by using the wonderful CorePlot (1) framework. >> I've asked on the Coreplot

Convert PDF CGContextRef to NSView for hi-res printing

2012-03-05 Thread Gilles Celli
Hi, I'm stuck on a problem on how to print high resolution graphs on Mac OS X, by using the wonderful CorePlot (1) framework. I've asked on the Coreplot mailing list but no answer...maybe it's too obvious that I don't see the tree in the forest: My method produces a CGContextRef (with CGPDFCont

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-10 Thread Gilles Celli
ing wrong here :-( >> >> Any clues ? > > Yep, here we go: > > On 10 Feb 2012, at 15:28, Gilles Celli wrote: > >> In my NSDocument readFromURL:ofType:error: method it init's a >> progressLoading WindowController (which shows up the window with progress >&g

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-10 Thread Gilles Celli
Abdullah wrote: > > On 9 Feb 2012, at 20:23, Gilles Celli wrote: > >> Mike, Kyle, >> >> Thanks for the quick answers! >> >> Yes I'm targeting Mac OS X 10.6 and later so >> canConcurrentlyReadDocumentsOfType: is a welcome addition, I completel

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Gilles Celli
nside readFromURL, should I fire up a new thread to check the flag's status ? Gilles On Feb 9, 2012, at 7:32 PM, Kyle Sluder wrote: > On Thu, Feb 9, 2012 at 8:01 AM, Gilles Celli wrote: >> Hi, >> >> I searched the mailing-list but didn't find an answer….so sorry if thi

How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Gilles Celli
Hi, I searched the mailing-list but didn't find an answer….so sorry if this was posted before: I've setup a document based application which can read large ASCII data files (>150MB). When opening the document the method readFromURL:ofType:error is used which then opens a small feedback window

Re: NSIndexSet of NSButtonCells in NSOutlineView

2011-12-08 Thread Gilles Celli
little bit more clear now ... Gilles On 8 déc. 2011, at 19:13, Quincey Morris wrote: > On Dec 8, 2011, at 08:12 , Gilles Celli wrote: > >> The instrument's name is selectable as an NSButtonCell, the idea is to turn >> on/off its respective graph / plot. >> So the

NSIndexSet of NSButtonCells in NSOutlineView

2011-12-08 Thread Gilles Celli
Hi, I've the following problem: I'm writing an application which will display plots / graph: an NSOutlineView has been setup and working which displays the name, location of some scientific instruments (like thermometer, voltage etc.). The instrument's name is selectable as an NSButtonCell, the

Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-25 Thread Gilles Celli
@ | item isChecked: %d ", [(OvItem *)item name], [(OvItem *)item isChecked] ); } } Cheers, Gilles On Nov 24, 2011, at 6:47 PM, Quincey Morris wrote: > On Nov 24, 2011, at 05:46 , Gilles Celli wrote: > >> My hierearchical list will not changed or sorted in the >> NSoutl

Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-24 Thread Gilles Celli
ote: > On Nov 23, 2011, at 12:40 , Gilles Celli wrote: > >> things are a little more clear now, so I will stick with the NSArray version. > > Actually, I gave you a partially wrong answer. I noticed you are using a > NSOutlineView, but then I forgot to take into account th

Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-23 Thread Gilles Celli
ould I get the index value ? On 23 nov. 2011, at 19:32, Quincey Morris wrote: > On Nov 23, 2011, at 07:58 , Gilles Celli wrote: > >> I've setup an NSOutlineView with 2 colums: the first one named >> "buttonColumns" with NSButtonCell (Switch ON / OFF) >&

Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-23 Thread Gilles Celli
Hello, I've setup an NSOutlineView with 2 colums: the first one named "buttonColumns" with NSButtonCell (Switch ON / OFF) and the second one with TextFieldCell… While the state change works for NSButtonCell in the buttonColum I had to create an NSArray *checks to set it ON or OFF. Is there an e

Re: NSOutlineView - display NSButtonCell only for leaf node with outlineView:dataCellForTableColumn:item: method

2011-10-03 Thread Gilles Celli
Quincey, thanks for the quick reply! As you suggested I tried the different options (putting a button cell in IB) and also returning with a non-nil cell for the NSOutlineView…but I'm not quite sure what you mean: Do I need to remove the "buttonColumn" and have only one column ? And then generat

NSOutlineView - display NSButtonCell only for leaf node with outlineView:dataCellForTableColumn:item: method

2011-10-02 Thread Gilles Celli
Hi, I've setup an NSOutlineView which displays items of a data acquisiton system this way +-LocationName +--InstrumentNameA +DataTypeNameA1 +DataTypeNameA2 +DataTypeNameA3 + +--InstrumentNameB +DataTypeNameB1

Re: NSOutlineView - Items only displays when user scrolls in outline view

2011-10-02 Thread Gilles Celli
2011, at 10:48 PM, Gilles Celli wrote: > >> Yes forgot to say that I've a data source for the outline view…. >> >> My OvItem.h class looks like this: > > > Yes, but how and when does that structure get established? That's what > matters here - o

Re: NSOutlineView - Items only displays when user scrolls in outline view

2011-09-02 Thread Gilles Celli
Michael & Graham: thanks for the reply I agree that my Item class and its structure for the outline view has to be reworked...I'll let you know since I'm on vacancy for one week… -Gilles On 2 sept. 2011, at 14:35, Michael Babin wrote: > On Sep 2, 2011, at 7:15 AM, G

Re: NSOutlineView - Items only displays when user scrolls in outline view

2011-09-02 Thread Gilles Celli
ex]; } -(void) dealloc { self.title = nil; self.children = nil; //[children release]; //[title release]; [super dealloc]; } On Sep 2, 2011, at 2:35 PM, Michael Babin wrote: > On Sep 2, 2011, at 7:15 AM, Gilles

NSOutlineView - Items only displays when user scrolls in outline view

2011-09-02 Thread Gilles Celli
Hello, I've setup a Document based application with an NSOutlineView which displays Parent-Item along with its children…with XCode 4 on OS X Lion. When launching the application, the outline view shows the Root title…only if I refresh the outline view the children are displayed too. I've also