|
|
Occasionally, you may want to do different processing depending on the number of items connected to your current menu. Function item_count returns the number of items connected to a menu.
SYNOPSIS
int item_count (menu) MENU menu;If menu is NULL, function item_count returns -1.
As an example of the use of this function, consider the following routine. Because the index to the last menu item is one less than the number of items, this routine determines whether the last item is displayed.
int at_bottom (m) /* check visibility of last menu item */ MENU * m; { ITEM ** i = menu_items (m); ITEM * lastitem = i[item_count(m)-1];return item_visible (lastitem); }