next up previous
Next: The final product Up: Adding a Graphical User Previous: Running the GTK main

Exercises

The source code for the Threading example can be found here.

  1. Add a pause button to the controller. You will need to create another threading event to signal to the subjects to pause.
  2. The start button also serves as a stop button. Modify the code to change the label on the start button to ``Stop'' whenever the start button is pressed, but changed back to ``Start'' whenever the stop button is pressed.
  3. You can't pause a simulation if it isn't running. Modify your code to desensitise the pause button when the simulation is stopped.



James Roper 2004-02-12