From 9451f0b8889b438aa96be297cf32ef75d200b858 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Fri, 20 Mar 2015 17:17:27 +0000 Subject: Documentation: Clarify Fl_Menu_Item::size() docs. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10644 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Menu.cxx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index 7493087f2..661684c35 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -29,7 +29,32 @@ #include #include "flstring.h" -/** Size of the menu starting from this menu item */ +/** Size of the menu starting from this menu item. + + This method counts all menu items starting with \p this menu item, + including all menu items in the same (sub)menu level, all nested + submenus, \b and the terminating empty (0) menu item. + + It does \b not count menu items referred to by FL_SUBMENU_POINTER + menu items (except the single menu item with FL_SUBMENU_POINTER). + + All menu items counted are consecutive in memory (one array). + + Example: + + \code + schemechoice = new Fl_Choice(X+125,Y,140,25,"FLTK Scheme"); + schemechoice->add("none"); + schemechoice->add("plastic"); + schemechoice->add("gtk+"); + schemechoice->add("gleam"); + printf("schemechoice->menu()->size() = %d\n", schemechoice->menu()->size()); + \endcode + + Output: + + schemechoice->menu()->%size() = 5 +*/ int Fl_Menu_Item::size() const { const Fl_Menu_Item* m = this; int nest = 0; -- cgit v1.2.3