Re: Text file

2010-04-19 Thread Henrietta Read
That's a good idea, thank you! :) On Sun, Apr 18, 2010 at 12:41 PM, Jens Alfke wrote: > > On Apr 18, 2010, at 12:40 AM, Henrietta Read wrote: > > > exactly the point germane, but in perusing NSString.h one is given to > understand this method might not be as 'sma

Re: Text file

2010-04-18 Thread Henrietta Read
>> The call to -stringWithContentsOfFile: looks correct, but you're failing to check for errors. If it fails, it will return nil, and passing nil to setString: is illegal and will throw an exception. right, right... most correct. I can catch the nil. >> This leaves the question of why -stringWith

Text file

2010-04-15 Thread Henrietta Read
Hi, What's the correct way to open a text file? I'm using: NSError *error = nil; NSStringEncoding encoding; [myMutableString setString:[NSString stringWithContentsOfFile:filePath usedEncoding:&encoding error:&error]]; but on some files (say, Western Mac OS Roman) it crashes. 0x91dc50

[[sender selectedCell] tag] crashes in 10.6

2010-01-02 Thread Henrietta Read
Hi, Think I must be doing something wrong, I just got a new laptop with 10.6 for Christmas. My app that works fine in 10.5 seems to have all its pop-up menus broken... ??? Here's the code: - (IBAction)myPopupButton:(id)sender { gMyPopupButtonSetting = [[sender selectedCell] tag]; } 'gMyPop

Re: masking events from Image Well

2009-05-05 Thread Henrietta Read
Sorry to bother, got it all fixed with: [[self window] discardEventsMatchingMask:NSLeftMouseDraggedMask beforeEvent:theEvent]; On Tue, May 5, 2009 at 6:09 AM, Henrietta Read wrote: > Hi, > > I'm using an Image Well as a button... such as: > > > - (

masking events from Image Well

2009-05-05 Thread Henrietta Read
Hi, I'm using an Image Well as a button... such as: - (void)mouseDown:(NSEvent *)theEvent { theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask]; switch([theEvent type]) { case NSLeftMouseUp: DoVariousImportantThingsHere(); [vi

Re: NSSavePanel runModalForDirectory, set name selection?

2009-04-30 Thread Henrietta Read
eAtPath = [fileManager displayNameAtPath:[sheet > filename]]; > . > > .. > . > } > } > > Tom > > > On Apr 30, 2009, at 3:28 PM, Henrietta Read wrote: > > Question, > > I'm passing a file name such as 'MyTextFile.txt' to NSSavePanel > runM

NSSavePanel runModalForDirectory, set name selection?

2009-04-30 Thread Henrietta Read
Question, I'm passing a file name such as 'MyTextFile.txt' to NSSavePanel runModalForDirectory. When the panel appears the entire string is selected, but I would rather that just 'MyTextFile' is selected. Is it possible to set the selection to exclude the file extension? Thank you.

Drag and drop display image and file path?

2009-04-21 Thread Henrietta Read
Hi, I have an Image Well (NSImageView) in a window. I would like to display a drag and drop image in the view and pass the file path on to my controller object. In my 'MyImageView' object I'm doing: - (NSDragOperation)draggingEntered:(id )sender { if((NSDragOperationGeneric & [sender