Exercises 4.3

  1. Add a Find command to the List menu. This command will trigger the find method when selected. The find method prompts the user for an item and searches for it in the list. If the item is found, the method highlights the item; otherwise, the method displays an appropriate message.
  2. Add a Clear command to the List menu. This command will trigger the clear method. The clear method clears the list after first asking for confirmation from the user. Instead of a prompter, use the MessageBox confirm: message, which returns true or false based on a yes or no answer from the user.
  3. Use the class hierarchy browser to examine the methods for ListPane. Write a brief essay on the following topics:
    1. Forcing the selection of an item in the list pane under program control. How could this be done when the window is first opened?
    2. Referencing the items in the list pane by index position rather than item name. How would this be done to obtain the selected item or force its selection?