Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrFusion

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
Did anyone ever managed to get NSSavePanel to accept folders as a valid choice? Googling this question, I can tell it has been asked ad nauseam. However, I didn't find a working solution. It should be possible, since NSOpenPanel is a subclass of NSSavePanel. In my case, both a folder and a filename are valid export destinations.

It's easy to set an empty extension and use the "filename" as a folder to be created, but this doesn't allow the user to pick an existing folder.
Ignoring the filename is also possible, but is not so nice from a GUI perspective.

If you select a folder, but leave the filename empty, the return button is grayed out. How do I gain control over this button?

I tried
Code:
- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename
but this only gets called when the user hits return.

I tried subclassing, but
Code:
-(BOOL) validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem
is never called.

Any other suggestions?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.