FLTK: Fl_Multi_Label Struct Reference

FLTK

Public Member Functions | Public Attributes | List of all members
Fl_Multi_Label Struct Reference

This struct allows multiple labels to be added to objects that might normally have only one label. More...

`#include <Fl_Multi_Label.H>`

## Public Member Functions
void | label (Fl_Menu_Item *)
| This method is used to associate a Fl_Multi_Label with a Fl_Menu_Item.
void | label (Fl_Widget *)
| This method is used to associate a Fl_Multi_Label with a Fl_Widget.

## Public Attributes
const char * | labela
| Holds the "leftmost" of the two elements in the composite label. More...
const char * | labelb
| Holds the "rightmost" of the two elements in the composite label. More...
uchar | typea
| Holds the "type" of labela. More...
uchar | typeb
| Holds the "type" of labelb. More...

## Detailed Description

This struct allows multiple labels to be added to objects that might normally have only one label.

This struct allows a mixed text and/or graphics label to be applied to an object that would normally only have a single (usually text only) label.

Most regular FLTK widgets now support the ability to associate both images and text with a label but some special cases, notably the non-widget Fl_Menu_Item objects, do not. Fl_Multi_Label may be used to create menu items that have an icon and text, which would not normally be possible for an Fl_Menu_Item. For example, Fl_Multi_Label is used in the New->Code submenu in fluid, and others.

Each Fl_Multi_Label holds two elements, labela and labelb; each may hold either a text label (const char*) or an image (Fl_Image*). When displayed, labela is drawn first and labelb is drawn immediately to its right.

More complex labels might be constructed by setting labelb as another Fl_Multi_Label and thus chaining up a series of label elements.

When assigning a label element to one of labela or labelb, they should be explicitly cast to (const char*) if they are not of that type already.

See also
  Fl_Label and Fl_Labeltype

## Member Data Documentation

## ◆ labela

const char* Fl_Multi_Label::labela

Holds the "leftmost" of the two elements in the composite label.

Typically this would be assigned either a text string (const char*), a (Fl_Image*) or a (Fl_Multi_Label*).

## ◆ labelb

const char* Fl_Multi_Label::labelb

Holds the "rightmost" of the two elements in the composite label.

Typically this would be assigned either a text string (const char*), a (Fl_Image*) or a (Fl_Multi_Label*).

## ◆ typea

uchar Fl_Multi_Label::typea

Holds the "type" of labela.

Typically this is set to FL_NORMAL_LABEL for a text label, _FL_IMAGE_LABEL for an image (based on Fl_image) or _FL_MULTI_LABEL if "chaining" multiple Fl_Multi_Label elements together.

## ◆ typeb

uchar Fl_Multi_Label::typeb

Holds the "type" of labelb.

Typically this is set to FL_NORMAL_LABEL for a text label, _FL_IMAGE_LABEL for an image (based on Fl_image) or _FL_MULTI_LABEL if "chaining" multiple Fl_Multi_Label elements together.

The documentation for this struct was generated from the following files:

- Fl_Multi_Label.H
- Fl_Multi_Label.cxx

- © 1998-2016 by Bill Spitzak and others.