fltk.multilabel
Multi-label module for FLTK.
This module provides the MultiLabel class for creating compound labels with multiple parts (text + image, etc.) that can be applied to widgets and menu items.
Example:
import fltk.multilabel;
import fltk.widgets;
// Create a multi-label with icon and text
auto ml = new MultiLabel();
ml.setLabelAImage(myIcon);
ml.setLabelBText(" Open File");
// Apply to a button
ml.label(myButton);Copyright
Types 2
Label type constants.
These determine how each part of a multi-label is interpreted. Values match FLTK's Fl_Labeltype enum.
Class for creating compound labels with multiple parts.
MultiLabel allows combining text and images into a single label that can be applied to widgets or menu items. This is particularly useful for menu items that need both an icon and text.
Each MultiLabel has two parts: labelA (left) and labelB (right). Either part can be text or an image. Multiple MultiLabels can be chained together for more complex labels.
Example:
// Create icon + text label for a menu item
auto ml = new MultiLabel();
ml.setLabelAImage(folderIcon);
ml.setLabelBText(" Open Folder");
// Apply to menu item
ml.label(menuBar, itemIndex);
// Create text + text label for a widget
auto ml2 = new MultiLabel();
ml2.setLabelAText("Status: ");
ml2.setLabelBText("Ready");
ml2.label(statusWidget);Note
the widget/menu item it is applied to, as FLTK stores a pointer to it.
void setLabelAText(string text)Sets the first (left) label element as text.void setLabelBText(string text)Sets the second (right) label element as text.this()Creates a new multi-label.