DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
ETI menus

Fetching and changing the top row

Function top_row returns the number of the menu row currently displayed at the top of your end-user's menu. Function set_top_row sets the top of the menu to the named row, unless the row does not start a complete page of items. In this case, it returns E_BAD_ARGUMENT.

SYNOPSIS

   int set_top_row(menu, row)
   MENU * menu;
   int row;
   

int top_row(menu) MENU * menu;

Function set_top_row sets the current item to the leftmost item in the new top row. Variable row must be in the range of 0 through TR-VR, where TR is the total number of rows as determined by the menu format and VR is the number of visible rows. If the value of row is greater, the row does not start a complete page of items. See ``Specifying the menu format'' for details on menu display.

When a menu is created by new_menu or the items associated with the menu are changed by set_menu_items, the top row is set to 0.


NOTE: If the menu format or the O_ROWMAJOR option is changed, the top row is automatically set to 0. See ``Specifying the menu format'' and ``Setting and fetching menu options'' for details on changing these menu attributes.

In addition, if the current item is changed by set_current_item or set_menu_pattern to an item that is not currently visible, the top row is generally set to the row that contains the new current item. The sole exception occurs when, as noted above, the top row does not start a complete page of items.

If successful, function set_top_row returns E_OK. If an error occurs, set_top_item returns one of the following:


E_SYSTEM_ERROR
system error

E_BAD_ARGUMENT
NULL menu pointer or index out of range

E_BAD_STATE
called from init/term routines

E_NOT_CONNECTED
no connected items
Function top_row returns -1 if given a NULL menu pointer or no items are connected to the menu.
Next topic: Positioning the menu cursor
Previous topic: Fetching and changing the current item

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004