Next: Button Types, Up: Part III Button-like Objects [Contents][Index]

### 16.1 Adding Button Objects

Adding an object To add buttons use one of the following routines:

    FL_OBJECT *fl_add_button(int type, FL_Coord x, FL_Coord y,
                             FL_Coord w, FL_Coord h,
                             const char *label);
    FL_OBJECT *fl_add_lightbutton(int type, FL_Coord x, FL_Coord y,
                                  FL_Coord w, FL_Coord h,
                                  const char *label);
    FL_OBJECT *fl_add_roundbutton(int type, FL_Coord x, FL_Coord y,
                                  FL_Coord w, FL_Coord h,
                                  const char *label);
    FL_OBJECT *fl_add_round3dbutton(int type, FL_Coord x, FL_Coord y,
                                    FL_Coord w, FL_Coord h,
                                    const char *label);
    FL_OBJECT *fl_add_checkbutton(int type, FL_Coord x, FL_Coord y,
                                  FL_Coord w, FL_Coord h,
                                  const char *label);
    FL_OBJECT *fl_add_bitmapbutton(int type, FL_Coord x, FL_Coord y,
                                   FL_Coord w, FL_Coord h,
                                   const char *label);
    FL_OBJECT *fl_add_pixmapbutton(int type, FL_Coord x, FL_Coord y,
                                   FL_Coord w, FL_Coord h,
                                   const char *label);
    FL_OBJECT *fl_add_labelbutton(int type, FL_Coord x, FL_Coord y,
                                  FL_Coord w, FL_Coord h,
                                  const char *label);
    FL_OBJECT *fl_add_scrollbutton(int type, FL_Coord x, FL_Coord y,
                                   FL_Coord w, FL_Coord h,
                                   const char *label);

These finctions create buttons of the following classes:

`FL_BUTTON`

  A standard normal button.

`FL_LIGHTBUTTON`

  A button with a small embedded, colored area that changes color when the button is in the on state.

`FL_ROUNDBUTTON`

  A circular button (with a label beside). The inner area of the circle changes color when the button is on. Often used for radio buttons.

`FL_ROUND3DBUTTON`

  Just like the `FL_ROUNDBUTTON` but the circle is dran in a 3D-fashion.

`FL_CHECKBUTTON`

  Button shaped in the form of a rhombus slightly raised above the forms plane when off and slightly embossed (ypically with a different color) when on.

`FL_BITMAPBUTTON`

  Button decorated with a bitmap (often read in from an X bitmap file with extension `xbm`) in additional to a label.

`FL_PIXMAPBUTTON`

  Button decorated with a pixmap (often read in from an X pixmap file with extension `xpm`) in additional to a label. An additonal pixmap can be set for the case that the mouse hoovers over the button.

`FL_LABELBUTTON`

  A button that does not appear to be a button, only its label is shown, can be used e.g., for hyperlinks.

`FL_SCROLLBARBUTTON`

  A button mostly used at the ends of scrollbars - instead of a label it can only contain a triangle pointing up, down, left or right.

The meaning of the parameters is as usual. The label is by default placed inside the button for button and lightbutton. For roundbutton, round3dbutton, bitmapbutton and pixmapbutton, it is placed to the right of the circle and to the bottom of the bitmap/pixmap respectively. For scrollbutton, the label must be of some pre-determined string that indicates the direction of the scroll arrow.

Next: Button Types, Up: Part III Button-like Objects [Contents][Index]