summaryrefslogtreecommitdiff
path: root/src/Fl_Menu.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2015-03-20 17:17:27 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2015-03-20 17:17:27 +0000
commit9451f0b8889b438aa96be297cf32ef75d200b858 (patch)
tree8cb7e40dce196690d1918b48c39e8a50657bc34a /src/Fl_Menu.cxx
parentb89035f360d72223d596b861cf2a067a6f6f1345 (diff)
Documentation: Clarify Fl_Menu_Item::size() docs.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10644 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Menu.cxx')
-rw-r--r--src/Fl_Menu.cxx27
1 files changed, 26 insertions, 1 deletions
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 <stdio.h>
#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;