#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Pixmap.H>

// A tiny red diamond, stored as XPM image data
static const char *const icon_xpm[] = {
    "12 12 2 1",
    "  c None",
    "* c #E33E36",
    "     **     ",
    "    ****    ",
    "   ******   ",
    "  ********  ",
    " ********** ",
    "************",
    "************",
    " ********** ",
    "  ********  ",
    "   ******   ",
    "    ****    ",
    "     **     "
};

enum {
    label_w = 420,
    label_h = 60,
    num_labels = 5,
    space = 20,
    font_size = 30
};

const Fl_Labeltype label_types[] = {
    FL_NORMAL_LABEL, FL_SHADOW_LABEL, FL_ENGRAVED_LABEL, FL_EMBOSSED_LABEL
};

const char * const label_text[] = {
    "Normal", "Shadow", "Engraved", "Embossed", "Image + Text"
};


int main()
{
    int win_w = label_w + 2 * space;
    int win_h = num_labels * label_h + (num_labels + 1) * space;
    Fl_Window win(win_w, win_h, "FLTK label types");

    Fl_Pixmap icon(icon_xpm);
    for (int i = 0; i < num_labels; i++) {
        int y = i * label_h + (i + 1) * space;
        Fl_Box *box = new Fl_Box(space, y, label_w, label_h, label_text[i]);
        box->labelsize(font_size);
        if (i == num_labels - 1) {
            box->image(icon);
            box->align(FL_ALIGN_IMAGE_NEXT_TO_TEXT);
        } else
            box->labeltype(label_types[i]);
    }

    win.end();
    win.show();

    return Fl::run();
}
