• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using Carbon Events in a Cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using Carbon Events in a Cocoa app


  • Subject: Using Carbon Events in a Cocoa app
  • From: Sarwat Khan <email@hidden>
  • Date: Sun, 30 Sep 2001 13:55:27 -0400

Hi,

I'm trying to run the QT Standard Effects dialog from Cocoa,
which requires running a WaitNextEvent loop. The code I'm
currently using is below.

I've got one main problem with this. When the dialog comes up,
it draws the whole dialog fine, but then for some reason
immediately erases the content area (the area that lets you edit
the effect). There are other issues, like being able to select
menu commands and raise other windows.

Also, kEventDurationForever should change, because filter
previews like Film Noise don't animate unless if you move the
mouse.


- (BOOL) _runDialogInEventLoop:(QTParameterDialog)dialogID
{
EventRef theEvent;
EventTargetRef theTarget;
EventRecord theRecord;
OSErr result;
BOOL done = NO;
BOOL useEffect = NO;

theTarget = GetEventDispatcherTarget();

while (ReceiveNextEvent(0, NULL, kEventDurationForever,true,
&theEvent) == noErr
&& done == NO)
{
//check if it's an event for the dialog.
ConvertEventRefToEventRecord(theEvent, &theRecord);

result = QTIsStandardParameterDialogEvent(&theRecord, dialogID);
switch (result)
{
case featureUnsupported:
SendEventToEventTarget(theEvent, theTarget);
break;

case codecParameterDialogConfirm:
QTDismissStandardParameterDialog(dialogID);
useEffect = YES;
dialogID = nil;
done = YES;
break;

case userCanceledErr:
QTDismissStandardParameterDialog(dialogID);
dialogID = nil;
done = YES;
break;
}

ReleaseEvent(theEvent);
}

return useEffect;
}

Thanks for any help,

Sarwat.


{sarwat khan : email@hidden : http://sarwat.net}


  • Prev by Date: Re: Does cocoa just leak?
  • Next by Date: Re: NSScrollView and general IB annoyance
  • Previous by thread: Re: How to write a menu extra?
  • Next by thread: When to buy Apple's documentation
  • Index(es):
    • Date
    • Thread