Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does QCPortAttributeMenuItemsKey work?



Thank you for your reply Marc.

Here is what worked in the end:

[self addInputPortWithType:QCPortTypeIndex forKey:@"inputBlend"
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:@"Blending"QCPortAttributeNameKey
[NSNumber numberWithUnsignedInteger:2], QCPortAttributeMaximumValueKey
[NSArray arrayWithObjects:@"Replace"@"Over"@"Add"nil], QCPortAttributeMenuItemsKey,
nil]];

The thing that was tripping me up was that QCPortAttributeMaximumValueKey has to be defined. The order of definition is also important. First QCPortAttributeMaximumValueKey, then QCPortAttributeMenuItemsKey. Of course the port's type has to be defined as QCPortTypeIndex, but the documentation is explicit enough about that. The rest was a bit unclear to me I must say... Anyway, I filed some feedback about that, so I hope the documentation will be more explicit in the future.

The next problem though, is how do I do this for a predefined port? The logic of this seems correct, yet it doesn't work for me:

return [NSDictionary dictionaryWithObjectsAndKeys:QCPortTypeIndex, QCPortAttributeTypeKey,
@"Blending", QCPortAttributeNameKey
[NSNumber numberWithUnsignedInteger:2], QCPortAttributeMaximumValueKey
[NSArray arrayWithObjects:@"Replace", @"Over", @"Add", nil], QCPortAttributeMenuItemsKey,
nil];

Can anyone out there clear this up?

Thanks


On 25 Feb 2008, at 12:23, Marc Epard wrote:

I've only used it in attributesForPropertyPortWithKey for predefined ports, but it works.  Try adding min and max and maybe default keys:

[NSNumber numberWithUnsignedInteger:0],  QCPortAttributeDefaultValueKey,
[NSNumber numberWithUnsignedInteger:0],  QCPortAttributeMinimumValueKey,
[NSNumber numberWithUnsignedInteger:count-1],  QCPortAttributeMaximumValueKey,

-Marc

On Feb 25, 2008, at 3:25 AM, Julien Rigal wrote:
Hello once again,

Sorry to post such a newbie question, but how do I use QCPortAttributeMenuItemsKey to add a list of menu items to a port. I tried this, but it doesn't work, QC raises an exception.

[self addInputPortWithType:QCPortTypeIndex forKey:@"inputBlend"
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:@"Blending", QCPortAttributeNameKey,
[NSArray arrayWithObjects:@"Replace", @"Over", @"Add", nil], QCPortAttributeMenuItemsKey,
nil]];

I tried a few other things, but can't seem to find the correct way...

Thanks!

Regards,

Julien
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden

References: 
 >How does QCPortAttributeMenuItemsKey work? (From: Julien Rigal <email@hidden>)
 >Re: How does QCPortAttributeMenuItemsKey work? (From: Marc Epard <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.