X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=menu%2Fm_item_top.c;h=68303c7676b5e6b2395d64c27391dc9998d10da7;hb=f259fb41d8f08b7e042eb928b839b59c8e39098c;hp=ee0d17b43dd55c16fca16d918dde8a3ea6f45d27;hpb=5925150381bb42a4d8c7116d62c348a7b84309f3;p=ncurses.git diff --git a/menu/m_item_top.c b/menu/m_item_top.c index ee0d17b4..68303c76 100644 --- a/menu/m_item_top.c +++ b/menu/m_item_top.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2004,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -38,12 +38,12 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $") +MODULE_ID("$Id: m_item_top.c,v 1.16 2021/06/17 21:11:08 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_top_row(MENU *menu, int row) -| +| | Description : Makes the specified row the top row in the menu | | Return Values : E_OK - success @@ -53,8 +53,6 @@ MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $") MENU_EXPORT(int) set_top_row(MENU *menu, int row) { - ITEM *item; - T((T_CALLED("set_top_row(%p,%d)"), (void *)menu, row)); if (menu) @@ -72,6 +70,8 @@ set_top_row(MENU *menu, int row) if (row != menu->toprow) { + ITEM *item; + if (menu->status & _LINK_NEEDED) _nc_Link_Items(menu); @@ -85,9 +85,9 @@ set_top_row(MENU *menu, int row) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int top_row(const MENU *) -| +| | Description : Return the top row of the menu | | Return Values : The row number or ERR if there is no row