next up previous contents
Next: Adding a New Library Up: Writing the Standard Panel Previous: trial_read_window()   Contents


trial_data_refresh()

This routine should read all the information from the data structure and write it into the window.

/*
 * trial_data_refresh()
 *
 * routine to refresh the data in all items in the trial window
 */
int
  trial_data_refresh()
{
  int format, i, n_varb;
  char strng[20];

  /* if no window, then nothing to refresh */
  if (trial_ip == NULL) return;

  /* read information on precision of doubles */
  format = *((int *) pm(GET, Defaults, Precision, NULL));

  n_varb = *((int *) pm(GET, Traj_Ds_Object, Varb_Dim, NULL));

  /* refresh text fields */
  for(i=0; i<n_varb; i++) 
    {
      sprintf(strng, "%.*lg",format,trial_varb_value[i]);
xv_set(trial_ip->varb_value[i], PANEL_VALUE, strng, NULL);
    }

  /* refresh setting items */
  xv_set(trial_ip->setting1, PANEL_VALUE, trial_choice, NULL);
}



root
1998-11-02