User's Guide
Switch back to the Composition Editor and make the following
connections:
- Connect the toggle button's selection attribute to the
refreshEntireListOnChange attribute of the Container Icon Tree part
in the Discard window. This forces the container to repaint itself
whenever its contents change.
- Connect the Black Jack window's openedWidget event to the
openWidget action of the Discard window to open both windows when
the application starts.
- Connect the Container Icon Tree part's visualInfoRequested
event to the cardIcon: script to set the icons for the items
in the discard deck window.
- Connect the Container Icon Tree part's items attribute to
the suits script to display the root structure of the discard deck
tree. In the Attribute-from-script connection window select More
dependencies. In the Dependencies window
- Select the Discard Deck part.
- Select the deck attribute.
- Select the Add Row push button.
- Select the OK push button.
Select OK in the Attribute-from-script connection window to
complete the connection. The items in the Container Icon Tree part will
now be updated whenever the contents of the Discard Deck part changes.
- Connect the Container Icon Tree part's
itemChildrenRequested event to the childrenRequested
script to provide the container with the item's children whenever the
user expands the tree.
- Connect the Discard selected menu item's
clicked event to the Deal Deck part's
moveCards:to: action. This lets you move cards
from the Deal Deck to the Discard Deck. Complete this connection by
providing its parameters as follows:
- Connect the Container Icon List part's selectedItems
attribute to the anOrderedCollection parameter of the
connection.
- Connect the Discard Deck part's self attribute to the
aCardDeck parameter of the connection.
When you are done, your connections should look like this:

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]