next up previous contents
Next: Use of the Init function Up: The InitChange, ShowPage and PageEnd Previous: The InitChange, ShowPage and PageEnd

Use of the Change function

  The simplest case in which the Change function is to be used is when on widget have to be disabled, when another is in a specefic state. To see an example of this, imagine that there exists an element called number of backups to keep, which is disabled if another element e.g. use backup is deselected. This may look like this:

proc page {} {
  # page
  CheckBox backup -text "Use backup"
  Entry number -text "Number of backups to keep"

  Change {
    if {$backup} {
      Enable number
    } else {
      Disable number
    }
  }
}



Jesper Kjær Pedersen <blackie@imada.ou.dk>
Wed Oct 2 13:29:53 MET DST 1996