]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/demo_menus.c
ncurses 5.6 - patch 20080223
[ncurses.git] / test / demo_menus.c
index 80ad01cc6e742a1441c80150d6698d94fdea6b0a..d572b2d17c99b43ab2786ca725ccbc066926189a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 2005-2007,2008 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_menus.c,v 1.21 2007/07/21 17:45:09 tom Exp $
+ * $Id: demo_menus.c,v 1.23 2008/02/23 23:06:49 tom Exp $
  *
  * Demonstrate a variety of functions from the menu library.
  * Thomas Dickey - 2005/4/9
@@ -130,14 +130,14 @@ wGetchar(WINDOW *win)
     while ((c = wgetch(win)) == CTRL('T')) {
        if (_nc_tracing) {
            save_trace = _nc_tracing;
-           _tracef("TOGGLE-TRACING OFF");
+           Trace(("TOGGLE-TRACING OFF"));
            _nc_tracing = 0;
        } else {
            _nc_tracing = save_trace;
        }
        trace(_nc_tracing);
        if (_nc_tracing)
-           _tracef("TOGGLE-TRACING ON");
+           Trace(("TOGGLE-TRACING ON"));
     }
 #else
     c = wgetch(win);
@@ -270,7 +270,7 @@ menu_destroy(MENU * m)
 #if 0
        if (count > 0) {
            while (*ip) {
-               _tracef("freeing item %d:%d", ip - menu_items(m), count);
+               Trace(("freeing item %d:%d", ip - menu_items(m), count));
                free_item(*ip++);
            }
        }
@@ -291,7 +291,7 @@ menu_display(MENU * m)
 static void
 build_file_menu(MenuNo number)
 {
-    static const char *labels[] =
+    static CONST_MENUS char *labels[] =
     {
        "Exit",
        (char *) 0
@@ -299,7 +299,7 @@ build_file_menu(MenuNo number)
     static ITEM *items[SIZEOF(labels)];
 
     ITEM **ip = items;
-    const char **ap;
+    CONST_MENUS char **ap;
 
     for (ap = labels; *ap; ap++)
        *ip++ = new_item(*ap, "");
@@ -319,7 +319,7 @@ perform_file_menu(int cmd)
 static void
 build_select_menu(MenuNo number, char *filename)
 {
-    static const char *labels[] =
+    static CONST_MENUS char *labels[] =
     {
        "Lions",
        "Tigers",
@@ -339,7 +339,7 @@ build_select_menu(MenuNo number, char *filename)
     static ITEM **items;
 
     ITEM **ip;
-    const char **ap = 0;
+    CONST_MENUS char **ap = 0;
     unsigned count = 0;
 
     if (filename != 0) {
@@ -350,7 +350,8 @@ build_select_menu(MenuNo number, char *filename)
            unsigned size = sb.st_size;
            unsigned j, k;
            char *blob = malloc(size + 1);
-           const char **list = (const char **) calloc(sizeof(*list), size + 1);
+           CONST_MENUS char **list =
+           (CONST_MENUS char **) calloc(sizeof(*list), size + 1);
 
            items = (ITEM **) calloc(sizeof(ITEM *), size + 1);
            if (blob != 0 && list != 0) {
@@ -523,7 +524,7 @@ perform_trace_menu(int cmd)
                    newtrace |= t_tbl[item_index(*ip)].mask;
            }
            trace(newtrace);
-           _tracef("trace level interactively set to %s", tracetrace(_nc_tracing));
+           Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
 
            (void) mvprintw(LINES - 2, 0,
                            "Trace level is %s\n", tracetrace(_nc_tracing));
@@ -569,7 +570,7 @@ current_menu(void)
 static void
 build_menus(char *filename)
 {
-    static const char *labels[] =
+    static CONST_MENUS char *labels[] =
     {
        "File",
        "Select",
@@ -581,7 +582,7 @@ build_menus(char *filename)
     static ITEM *items[SIZEOF(labels)];
 
     ITEM **ip = items;
-    const char **ap;
+    CONST_MENUS char **ap;
 
     for (ap = labels; *ap; ap++)
        *ip++ = new_item(*ap, "");