In addition to what Chris said, you should also check if the value changed. If 
the self.inputOpenPanel value is true, and you only check for that, every frame 
a new panel will be requested and opened.

On Aug 21, 2010, at 12:09 AM, Christopher Wright wrote:

>> I'am trying to write a simple QCPlugin that open an OpenPanel and return the 
>> path to an output port.
> 
> JeanMarc, you are already too talented! :)
> 
>> - (BOOL) startExecution:(id<QCPlugInContext>)context
>> {
>> 
>>      if (self.inputOpenPanel==YES)
>>              {
>>              NSOpenPanel *myDearWindow =[NSOpenPanel openPanel];
>>                      if ([myDearWindow runModal] == NSOKButton) 
>>                      {
>>                      NSArray *fileToOpen = [myDearWindow filenames];
>>                      self.outputPath=[fileToOpen objectAtIndex:0];
>>                      }
>>      
>>              }
>>      return YES;
>> }
>> 
>> i'am not very successful with this code, the plugin compile fine but the 
>> openPanel doesn't open when the input port is set to TRUE.
>> Any  Idea ?
> 
> 
> -startExecution:(id)context is called _before_ the composition is executing 
> -- at that point in time, the input ports are usually undefined (their 
> default values, or 0 / nil).
> 
> Opening a panel automatically probably isn't a good idea (generating 
> thumbnails and other mundane operations will be confusing to the user), but 
> for a special case it might be ok.  In that case, you might want to skip the 
> if(self.inputOpenPanel == YES) check (but then it will always open).
> 
> --
> Christopher Wright
> [email protected]
> 
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/doktorp%40mac.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to