/****************************************************************************
- * Copyright (c) 2005-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2005-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: demo_menus.c,v 1.28 2008/08/23 20:31:54 tom Exp $
+ * $Id: demo_menus.c,v 1.34 2012/06/09 20:30:33 tom Exp $
*
* Demonstrate a variety of functions from the menu library.
* Thomas Dickey - 2005/4/9
#endif
/* FIXME: MENU.itemlen seems the only way to get actual width of items */
- result = (number - (eBanner + 1)) * (mpBanner->itemlen + spc_rows);
+ result = (number - (eBanner + 1)) * (menu_itemwidth(mpBanner) + spc_rows);
}
return result;
}
result = new_menu(items);
if (has_colors()) {
- set_menu_fore(result, COLOR_PAIR(1));
- set_menu_back(result, COLOR_PAIR(2));
+ set_menu_fore(result, (chtype) COLOR_PAIR(1));
+ set_menu_back(result, (chtype) COLOR_PAIR(2));
}
set_menu_format(result, maxrow, maxcol);
{
int count;
- Trace(("menu_destroy %p", m));
+ Trace(("menu_destroy %p", (void *) m));
if (m != 0) {
ITEM **items = menu_items(m);
const char *blob = 0;
count = item_count(m);
- Trace(("menu_destroy %p count %d", m, count));
+ Trace(("menu_destroy %p count %d", (void *) m, count));
if ((count > 0) && (m == mpSelect)) {
blob = item_name(*items);
}
CONST_MENUS char **list = typeCalloc(CONST_MENUS char *, size + 1);
items = typeCalloc(ITEM *, size + 1);
- Trace(("build_select_menu blob=%p, items=%p", blob, items));
+ Trace(("build_select_menu blob=%p, items=%p",
+ (void *) blob,
+ (void *) items));
if (blob != 0 && list != 0) {
FILE *fp = fopen(filename, "r");
if (fp != 0) {
trace(newtrace);
Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
- (void) mvprintw(LINES - 2, 0,
- "Trace level is %s\n", tracetrace(_nc_tracing));
+ MvPrintw(LINES - 2, 0,
+ "Trace level is %s\n", tracetrace(_nc_tracing));
refresh();
}
}
{
static const char *const tbl[] =
{
- "Usage: demo_menus [options]"
+ "Usage: demo_menus [options] [menu-file]"
,""
,"Options:"
#if HAVE_RIPOFFLINE