Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Publishing Ports

You’ll revise the MacEngraving composition provided with Mac OS X v10.5 so that it has two published input ports at the root macro patch level—one that controls the clear color and the other that controls the text shown on the computer.

  1. Open the MacEngraving composition located in Developer/Examples/Quartz Compositions/Interface Builder.

    Notice that the "Text" input port of the Image With String patch is gray, to indicate that this port is already published.

  2. Control-click the Clear Color input port on the Clear patch and choose Published Inputs > Clear Color. Then press Return.

    Notice that the Clear Color input port appears gray to indicate that it is published.

  3. In the Viewer window, click Input Parameters.

    The Text and Clear Color input ports appear as a sheet in the Viewer window. When you change the text and the clear color, you immediately see the results in the View window.

  4. Click the workspace to make sure that no patches are selected. Then open the Inspector to the Published Inputs & Outputs pane.

    You should see the Text and Clear Color input port names and the key assigned to each. The key for the Text input port is text. The key for the Clear Color input port is Clear_Color. Make note of these, because you must use these keys in Interface Builder to set up the bindings. The keys you supply in Interface Builder must match exactly what you see in this pane; keys are case-sensitive.


    The Published Input and Output ports pane in the Patch Inspector
  5. Save the composition and quit Quartz Composer.



< Previous PageNext Page > Hide TOC


Last updated: 2007-07-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice