Re: CGDisplayReconfigurationCallBack
Re: CGDisplayReconfigurationCallBack
- Subject: Re: CGDisplayReconfigurationCallBack
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 2 Apr 2008 01:19:24 +0200
As we are on the cocoa list, I assume you are using obj-c.
If you are using plain C API in your code, you should not have problem.
But if "// do stuff" contains some obj-c calls that can raise an
exception, you have to make sure to catch it.
void DisplayReconfigurationCallBack (CGDirectDisplayID display,
CGDisplayChangeSummaryFlags flags, void *userInfo)
{
if (flags & kCGDisplayAddFlag)
{
@try {
// do stuff
} @catch (NSException *exception) {
// an error occured (but should not). You can ignore it if you want.
you can log it, etc...
}
}
else if (flags & kCGDisplayRemoveFlag)
{
// do different stuff
}
}
Le 2 avr. 08 à 00:12, Trygve Inda a écrit :
void DisplayReconfigurationCallBack (CGDirectDisplayID display,
CGDisplayChangeSummaryFlags flags, void *userInfo)
{
if (flags & kCGDisplayAddFlag)
{
// do stuff
}
else if (flags & kCGDisplayRemoveFlag)
{
// do different stuff
}
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden