Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 24, 2009, 03:23 AM   #1
lopoz
macrumors regular
 
Join Date: May 2005
Check NSOpenPanel selection before openSheetDidEnd

Hello,

I have an image viewer that opens directories and loads the pictures contained in them. What I'd like to do is check the contents of the directory for the presence of pictures, BEFORE the openSheetDidEnd selector is called, show the user an alert if the directory doesn't contain any images and have the user pick another directory.

How can I achieve this?

Thanks in advance for any advice!
lopoz is offline   0 Reply With Quote
Old May 24, 2009, 10:46 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Setup a delegate on the open panel and implement panel:isValidFilename: - this will get called when the Open button is clicked. You can then return NO to force the user to select another file/folder.
kainjow is offline   0 Reply With Quote
Old May 25, 2009, 04:41 AM   #3
lopoz
Thread Starter
macrumors regular
 
Join Date: May 2005
Quote:
Originally Posted by kainjow View Post
Setup a delegate on the open panel and implement panel:isValidFilename: - this will get called when the Open button is clicked. You can then return NO to force the user to select another file/folder.
Thanks! I'll try that immediately!

And there I was trying to subclass NSOpenPanel.. It wasn't working out
lopoz is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
NSOpenPanel selection BollywooD Mac Programming 1 May 24, 2010 11:42 PM
iTunes check/uncheck selection - but it's still syncing? bozeefus Mac Applications and Mac App Store 3 Dec 26, 2008 04:34 PM
Check your ISO before a shoot. iBallz Digital Photography 24 Mar 4, 2008 01:12 PM
Checking ibook screen before buying(UK) caveman_uk Buying Tips, Advice and Discussion (archive) 6 Aug 9, 2005 10:16 AM
Checking G5 RAM before installing OS: possible? Blue Velvet Macintosh Computers 0 Aug 21, 2004 05:54 AM


All times are GMT -5. The time now is 05:53 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC