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

Positioning the menu cursor

Some applications may need to move the menu's window cursor from the position required for continued processing by the ETI menu driver. To move the cursor back to where it belongs, you use function pos_menu_cursor.

SYNOPSIS

   int pos_menu_cursor (menu)
   MENU * menu;

If your application does not change the cursor position in the menu window, calling this function is unnecessary.

Your application might change the cursor position automatically because of prior calls to menu driver initialization routines such as set_item_init. Or it might do so because of explicit calls to application routines such as writing a prompt. ``Returning cursor to its correct position for menu driver processing'' illustrates this usage.

   void generate_prompt (m)
   MENU * m;
   {
   

/* display the prompt string associated with the current item */

WINDOW * w = menu_win (m); char * s = item_userptr (current_item (m)); box (w, 0, 0); wmove (w, 0, 0); waddstr (w, s); pos_menu_cursor (m); }

Returning cursor to its correct position for menu driver processing

If function pos_menu_cursor is successful, it returns E_OK. In the following error situations, it fails and returns the indicated value:


E_SYSTEM_ERROR
system error

E_BAD_ARGUMENT
NULL menu pointer

E_NOT_POSTED
menu is not posted

Next topic: Changing and fetching the pattern buffer
Previous topic: Fetching and changing the top row

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