NetBSD Problem Report #47376

From www@NetBSD.org  Sat Dec 29 16:27:01 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id A419563EB00
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 29 Dec 2012 16:27:00 +0000 (UTC)
Message-Id: <20121229162659.B3E7563EB00@www.NetBSD.org>
Date: Sat, 29 Dec 2012 16:26:59 +0000 (UTC)
From: gnrp@komkon2.de
Reply-To: gnrp@komkon2.de
To: gnats-bugs@NetBSD.org
Subject: libmenu doesn't show menu_mark
X-Send-Pr-Version: www-1.0

>Number:         47376
>Category:       lib
>Synopsis:       libmenu doesn't show menu_mark
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 29 16:30:00 +0000 2012
>Last-Modified:  Sun Dec 30 10:35:02 +0000 2012
>Originator:     Julian Fagir
>Release:        NetBSD 6.0-RELEASE
>Organization:
>Environment:
>Description:
When trying to use the set_menu_mark of libmenu, it does not set the mark, but displays spaces instead of the set characters.
>How-To-Repeat:
Run this program:

#include <menu.h>
#include <form.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>

int
main(int arg, char *argv[])
{
        int i;
        WINDOW *mainwin;
        MENU *menu;
        ITEM *items[3];

        initscr();
        mainwin = newwin(20, 70, 2, 2);
        box(mainwin, 0, 0);
        mvwprintw(mainwin, 1, 1, "Creating window...");
        wrefresh(mainwin);

        items[0] = new_item("Bla1", NULL);
        items[1] = new_item("Bla2", NULL);
        items[2] = NULL;
        menu = new_menu(items);
        set_menu_win(menu, mainwin);
        set_menu_sub(menu, derwin(mainwin, 15, 60, 2, 2));
        set_menu_mark(menu, ">");
        refresh();

        post_menu(menu);
        wrefresh(mainwin);

        while (1) {
                menu_driver(menu, REQ_DOWN_ITEM);
                wrefresh(mainwin);
                sleep(1);
        }
        endwin();

        return 0;
}

>Fix:

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, lib-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: lib/47376: libmenu doesn't show menu_mark
Date: Sat, 29 Dec 2012 12:04:15 -0500

 On Dec 29,  4:30pm, gnrp@komkon2.de (gnrp@komkon2.de) wrote:
 -- Subject: lib/47376: libmenu doesn't show menu_mark

 | When trying to use the set_menu_mark of libmenu, it does not set the mark, but displays spaces instead of the set characters.

 This is because none of the items are selected. Try set_menu_unmark(menu, "!")
 and see that both menu items display !

 christos

From: Julian Djamil Fagir <gnrp@komkon2.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/47376: libmenu doesn't show menu_mark
Date: Sat, 29 Dec 2012 18:34:00 +0100

 --Sig_/L8DdsQkOcgfgQf6va2RO5Eo
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: quoted-printable

 Hi,

 On Sat, 29 Dec 2012 17:05:10 +0000 (UTC) Christos Zoulas wrote:
 > The following reply was made to PR lib/47376; it has been noted by GNATS.
 >=20
 > From: christos@zoulas.com (Christos Zoulas)
 > To: gnats-bugs@NetBSD.org, lib-bug-people@netbsd.org,=20
 > 	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 > Cc:=20
 > Subject: Re: lib/47376: libmenu doesn't show menu_mark
 > Date: Sat, 29 Dec 2012 12:04:15 -0500
 >=20
 >  On Dec 29,  4:30pm, gnrp@komkon2.de (gnrp@komkon2.de) wrote:
 >  -- Subject: lib/47376: libmenu doesn't show menu_mark
 > =20
 >  | When trying to use the set_menu_mark of libmenu, it does not set the
 > mark, but displays spaces instead of the set characters.=20
 >  This is because none of the items are selected. Try set_menu_unmark(menu,
 > "!") and see that both menu items display !

 ok, so a ncurses - nbcurses incompatibility?!
 With ncurses, the item with "your focus on it" (i.e. the selected one) is
 marked without explicitly marking it.

 Regards, Julian

 --Sig_/L8DdsQkOcgfgQf6va2RO5Eo
 Content-Type: application/pgp-signature; name=signature.asc
 Content-Disposition: attachment; filename=signature.asc

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (NetBSD)

 iEYEARECAAYFAlDfKYsACgkQc7h7cu1Hpp73ZACdE9kiz7tRPUM/OXkhNtAUFW7R
 0QwAn3XLTcCKR8hASJ1YWOSaQ7qp1PBl
 =Ux71
 -----END PGP SIGNATURE-----

 --Sig_/L8DdsQkOcgfgQf6va2RO5Eo--

From: "Valeriy E. Ushakov" <uwe@stderr.spb.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/47376: libmenu doesn't show menu_mark
Date: Sun, 30 Dec 2012 02:46:31 +0400

 On Sat, Dec 29, 2012 at 17:35:06 +0000, Julian Djamil Fagir wrote:

 >  ok, so a ncurses - nbcurses incompatibility?!
 >  With ncurses, the item with "your focus on it" (i.e. the selected one) is
 >  marked without explicitly marking it.

 This is documented at the end of menus(3), see "item marking".

 -uwe

From: Brett Lymn <blymn@internode.on.net>
To: Christos Zoulas <christos@zoulas.com>
Cc: gnats-bugs@NetBSD.org, lib-bug-people@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: lib/47376: libmenu doesn't show menu_mark
Date: Sun, 30 Dec 2012 21:03:57 +1030

 On Sat, Dec 29, 2012 at 12:04:15PM -0500, Christos Zoulas wrote:
 > On Dec 29,  4:30pm, gnrp@komkon2.de (gnrp@komkon2.de) wrote:
 > -- Subject: lib/47376: libmenu doesn't show menu_mark
 > 
 > | When trying to use the set_menu_mark of libmenu, it does not set the mark, but displays spaces instead of the set characters.
 > 
 > This is because none of the items are selected. Try set_menu_unmark(menu, "!")
 > and see that both menu items display !
 > 

 But if the menu is O_ONVEVALUE then the current item should be marked
 according to the ETI documents I have.  I have a fix for this already, I
 will commit it shortly.

 -- 
 Brett Lymn
 Staple Guns: because duct tape doesn't make that KerCHUNK sound - xkcd.com

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.