Subject: lib/21218: libmenu doesn't maintain current_item between post/unpost
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rtr@netbsd.org>
List: netbsd-bugs
Date: 04/17/2003 16:25:33
>Number:         21218
>Category:       lib
>Synopsis:       libmenu doesn't maintain current_item between post/unpost
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 17 16:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Tyler R. Retzlaff
>Release:        NetBSD 1.6Q
>Organization:
>Environment:
System: NetBSD silence 1.6Q NetBSD 1.6Q (silence) #0: Sat Apr 5 11:18:02 EST 200
3 rtr@silence:/x/build/silence i386

>Description:
If a menu is unposted and then re-posted the current item before
it was posted is lost and the new current item after re-posting
is the first item in the menu.  It should maintain the current
item across post/unpost operations.

>How-To-Repeat:
        MENU *m;
        ITEM *items[4];

        initscr();
        noecho();
        cbreak();

        items[0] = new_item("one", "");
        items[1] = new_item("two", "");
        items[2] = new_item("three", "");
        items[3] = NULL;

        m = new_menu(items);

        post_menu(m);
        wrefresh(stdscr);
        getch();
        menu_driver(m, REQ_NEXT_ITEM);
        wrefresh(stdscr);
        getch();
        unpost_menu(m);
        wrefresh(stdscr);
        getch();
        post_menu(m);
        wrefresh(stdscr);
        getch();
        endwin();

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: