next up previous contents
Next: Writing the Standard Panel Up: Writing the Panel Handlers Previous: A Text Field Notify   Contents

A Button Notify Handler

Each button item will need it's own notify handler, because clicking on different buttons should result in taking different actions! Essentially, they must first make sure that any information in the postmaster that they will use or modify is up to date. This requires calling the read window routines for the windows from which the data is read. For our example, this will be the Trial window and the Selected window, since we will be writing to the selected window. Then we perform the computations which we desire. Finally, we must call the data refresh routines for all the windows for which we called the read routines.

However, they may all have the following form:

/*
 * trial_button1_notify()
 *
 * notify callback function for `button1'.
 */
void
  trial_button1_notify(item, event)
Panel_item item;
Event *event;
{
  trial_read_window();
  selected_read_window();
  trial_button1_go();
  trial_data_refresh();
  sel_data_refresh();
}



root
1998-11-02