diff options
| author | Greg Ercolano <erco@seriss.com> | 2017-09-11 21:27:53 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2017-09-11 21:27:53 +0000 |
| commit | 3fe7b8c396e283d94347f8dc5c0ce9ae61781f25 (patch) | |
| tree | 83bf66ceac4365224f6178bfc48cec2bc8ff3e86 | |
| parent | 3d9014806563ceb1b2e4921f094f55bad68c1ada (diff) | |
Doxygen Fl_Multi_Label example code added. (STR #3400)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12445 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/Fl_Multi_Label.H | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/FL/Fl_Multi_Label.H b/FL/Fl_Multi_Label.H index 63d0ef2f3..732289772 100644 --- a/FL/Fl_Multi_Label.H +++ b/FL/Fl_Multi_Label.H @@ -43,7 +43,31 @@ struct Fl_Menu_Item; 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 Fl_Label and Fl_Labeltype + Example Use: Fl_Menu_Bar + \code + Fl_Pixmap *image = new Fl_Pixmap(..); // image for menu item; can be any Fl_Image based widget + Fl_Menu_Bar *menu = new Fl_Menu_Bar(..); // can be any Fl_Menu_ oriented widget (Fl_Choice, Fl_Menu_Button..) + + // Create a menu item + int i = menu->add("File/New", ..); + Fl_Menu_Item *item = (Fl_Menu_Item*)&(menu->menu()[i]); + + // Create a multi label, assign it an image + text + Fl_Multi_Label *ml = new Fl_Multi_Label; + + // Left side of label is an image + ml->typea = FL_IMAGE_LABEL; + ml->labela = (const char*)image; + + // Right side of label is label text + ml->typeb = FL_NORMAL_LABEL; + ml->labelb = item->label(); + + // Assign the multilabel to the menu item + ml->label(item); + \endcode + + \see Fl_Label and Fl_Labeltype and examples/howto-menu-with-images.cxx */ struct FL_EXPORT Fl_Multi_Label { /** Holds the "leftmost" of the two elements in the composite label. |
