Drop-down Lists


  typedef void (*ControlFunc)  (Control *c);


  Control *new_drop_list(Window *w, Rect r, char **lines,
                             ControlFunc fn);
  Control *add_drop_list(Control *c, Rect r, char **lines,
                             ControlFunc fn);

  long	   get_control_value(Control *c);


A drop list is a push-button which, when clicked, displays a drop-down menu list of selectable names. The control is created by new_drop_list on the specified window, within the given rectangle. The lines parameter is a NULL-terminated list of strings, to be displayed in the menu. The function pointer fn will be called when the user chooses one of the lines from the menu.

The add_drop_list function works in the same way as new_drop_list, except that it attaches the list to a control rather than directly to a window.

The program can determine which item was chosen by examining the control's value, using get_control_value. The first string in the list is numbered 0, the next 1, and so on.