/****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 2020-2021,2022 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_post.c,v 1.35 2021/03/27 23:46:29 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.38 2022/09/24 09:38:44 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
ITEM *item = menu->items[0];
ITEM *lastvert;
ITEM *hitem;
- int y = 0;
chtype s_bkgd;
assert(item && menu->win);
lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : item;
- do
+ if (item != NULL)
{
- ITEM *lasthor;
-
- wmove(menu->win, y, 0);
-
- hitem = item;
- lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
+ int y = 0;
do
{
- _nc_Post_Item(menu, hitem);
+ ITEM *lasthor;
- wattron(menu->win, (int)menu->back);
- if (((hitem = hitem->right) != lasthor) && hitem)
+ wmove(menu->win, y, 0);
+
+ hitem = item;
+ lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
+
+ do
{
- int i, j, cy, cx;
- chtype ch = ' ';
+ _nc_Post_Item(menu, hitem);
- getyx(menu->win, cy, cx);
- for (j = 0; j < menu->spc_rows; j++)
+ wattron(menu->win, (int)menu->back);
+ if (((hitem = hitem->right) != lasthor) && hitem)
{
- wmove(menu->win, cy + j, cx);
- for (i = 0; i < menu->spc_cols; i++)
+ int i, j, cy, cx;
+ chtype ch = ' ';
+
+ getyx(menu->win, cy, cx);
+ for (j = 0; j < menu->spc_rows; j++)
{
- waddch(menu->win, ch);
+ wmove(menu->win, cy + j, cx);
+ for (i = 0; i < menu->spc_cols; i++)
+ {
+ waddch(menu->win, ch);
+ }
}
+ wmove(menu->win, cy, cx + menu->spc_cols);
}
- wmove(menu->win, cy, cx + menu->spc_cols);
}
- }
- while (hitem && (hitem != lasthor));
- wattroff(menu->win, (int)menu->back);
+ while (hitem && (hitem != lasthor));
+ wattroff(menu->win, (int)menu->back);
- item = item->down;
- y += menu->spc_rows;
+ item = item->down;
+ y += menu->spc_rows;
+ }
+ while (item && (item != lastvert));
}
- while (item && (item != lastvert));
}
/*---------------------------------------------------------------------------