Next Previous Up Top Contents Index

6.9 Interacting with an application

6.9.4 An example interaction with Reversi

In the following example we interact with the Reversi application after first making a few moves.

1. Open the Reversi project, and choose Application > Start.
If you were following the Application > Debug example earlier in this chapter, you could simply choose Application > Resume instead of starting Reversi again.
2. Make some moves on the board.
3. Choose Application > Interact.
A debugger window appears, in the interaction layout of a large interaction pane and no stack or source panes.

Now we are ready to write Dylan code interactively. Note that because Application > Interact pauses the application, we are not interacting with a running application. The only way the state of the application changes is through our interactions. So we must choose Application > Resume to see interactive changes in effect.

As an example, we can change the shape of the pieces on the board by setting the value of the variable *reversi-piece-shape* instead of by going to Reversi's Options menu.

5. Enter *reversi-piece-shape* := #"triangle"; at the interaction pane prompt.
6. Choose Application > Resume.
7. Make a few moves on the Reversi board.
The new moves are shown in triangular pieces, as well as any previous moves that have repainted after being obscured by other windows. To see only triangular pieces, minimize and restore the board or resize it.

Getting Started with Functional Developer - 31 MAR 2000

Next Previous Up Top Contents Index