Tab Buttons


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


  Control *new_tab_button(Window *w, Rect r, char *text, ControlFunc fn);
  Control *add_tab_button(Control *c, Rect r, char *text, ControlFunc fn);


The new_tab_button function creates a tab-pane button control, with the given text string being centered within the button. The button will appear on the specified window in the rectangle, given in window co-ordinates.

When the user clicks on the tab button with the mouse, the specified call-back function fn is called. The parameter to this function will be a pointer to the button which called the function. Usually, this function will bring a control 'pane' to the front within a window, to display that pane, as well as bringing the tab button itself to the front.

The add_tab_button function works in the same way as new_tab_button, except that it attaches the tab button to a control rather than directly to a window.