image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
Thread Tools
  #1  
Old June 23rd, 2008, 03:30 AM
Registered User
 
Join Date: Mar 2007
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
yogish is on a distinguished road
Unhappy how to disable alert panel

when i try call open api on unmounted device.
i get "disk insertion" alert panel.

i want to disable this alert panel.
Reply With Quote
  #2  
Old June 25th, 2008, 10:12 PM
whitesaint's Avatar
cocoa love
 
Join Date: Jun 2001
Location: Clearwater, Florida
Posts: 698
Thanks: 0
Thanked 0 Times in 0 Posts
whitesaint is on a distinguished road
Which API are you using? It might be that the API won't work unless a disk is inserted. But that may not be the case. More information would definitely help.
__________________
Mac Mini Core 2 Duo
1 GB RAM
----------------------------------------------------------
Custom Mac OS X Software and Custom Websites
Reply With Quote
  #3  
Old June 26th, 2008, 12:06 AM
Registered User
 
Join Date: Mar 2007
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
yogish is on a distinguished road
i am using "open" function call on media card which is not mounted.
Reply With Quote
  #4  
Old June 26th, 2008, 01:47 AM
whitesaint's Avatar
cocoa love
 
Join Date: Jun 2001
Location: Clearwater, Florida
Posts: 698
Thanks: 0
Thanked 0 Times in 0 Posts
whitesaint is on a distinguished road
Well, I assume you're using Cocoa, in which there is nothing wrong with that.

Personally, I have no idea what you're doing, but I would just set up a NSTimer that checks every now and then to see if a disk was inserted. I.e.:

if (no disk)
{
[thisObject doNothing];
}
else //disk inserted
{
[thisObject performAction];
}

As far as I know there's nothing you can do to disable the Alert Panel that shows up if there is no disc inserted. This might be where one of the frameworks might help.

Also if you have access to the NSAlert window you can try the NSAlert method -(NSWindow*)window method which returns the NSWindow or NSPanel. From here you can set the window to close, be completely transparent, pretty much anything you want. I would aim for the NSAlert window if possible.

There are also a lot of APIs available that deal with certain system attributes, which might be more helpful, you can view them under /System/Library/Frameworks/

Not all of these frameworks have the best documentation nor can you guarantee the object you're messaging will work. But if you look hard enough, it might be there. Hope that helps.

Edit: ElDiabloConCaca gave a good answer in a previous thread in checking for mountable media through NSWorkspace, but if the media is not even in one of the computer's drives, it's going to be hard to check for a disk that isn't even there. Might want to check one of the existing frameworks.
__________________
Mac Mini Core 2 Duo
1 GB RAM
----------------------------------------------------------
Custom Mac OS X Software and Custom Websites

Last edited by whitesaint; June 26th, 2008 at 01:58 AM. Reason: checked a previous thread, thought of some new info
Reply With Quote
Reply

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 06:36 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.