Re: Setting initial filename for Save As
Re: Setting initial filename for Save As
- Subject: Re: Setting initial filename for Save As
- From: Robert Martin <email@hidden>
- Date: Tue, 13 Dec 2005 13:03:49 -0500
If you like living dangerously, there's a simple way to do this by
using a category. I can't recommend it since it goes around
NSSavePanel's API - and could break on the next OS update. However,
it works for me...
Basically, if you look at NSSavePanel.h you'll see: IBOutlet
NSTextField *_nameField; This is the text field for the file name.
All you have to do is set it. The idea is to add a setter in a
category like this:
@interface NSSavePanel(My_Extensions)
- (void)setFileName:(NSString*)newName;
@end
@implementation NSSavePanel(CPExtensions)
- (void)setFileName:(NSString*)newName
{
if (newName && _nameField)
[_nameField setStringValue:newName];
}
@end
HTH, Rob
On Dec 12, 2005, at 8:47 PM, Derrick Bass wrote:
I want to create a new filename from the old name (say Movie.mov ->
Movie-modded.mov) and present that as the default name to save under.
But I'm not quite sure how to go about it. I haven't noticed any
simple way to do it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden