bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to tell highlighted from selected items in multi-select menu?


From: Adam Spragg
Subject: How to tell highlighted from selected items in multi-select menu?
Date: Fri, 6 Jun 2008 16:48:01 +0100
User-agent: KMail/1.9.9

Dear ncurses maintainers,

I'm working on an ncurses program which needs to display a list of 
options to the user, from which they can select any number. I'm using a 
menu for this with O_ONEVALUE switched off, and it mostly seems to be 
fine. Items can be selected and deselected as necessary.

The problem is that it appears to be impossible for the user to 
distinguish between the currently highlighted item and selected items.

The highlighted item always looks selected, even if it isn't. If there 
are a number of selected items, it's impossible to tell which is the 
highlighted item, or if it's selected. There appears to be no visual 
feedback at all when moving between selected items. This is 
particularly awkward in my program as all items are initially selected, 
and the user uses the menu to unselect items. Navigating through the 
menu provides no feedback, and unselecting an item provides no feedback 
until the user navigates to a different item. Worse, it looks like the 
only unselected item is the currently highlighted one as it is now a 
different color to all the others.

I've looked through the documentation as much as I can and can't find 
anything about this. The closest is the the "attributes" 
({set_,}menu_{fore,back,grey,pad}()) man page, which only mentions a 
distinction between selected(/highlighted?), unselected and 
unselectable items.

Is there something I'm missing here that can help? I'm using ncurses 
5.6+20080531-1 from Debian Unstable.

Test program that illustrates the problem attached.

Adam Spragg.


p.s. One other thing that I found - it seems that the initial selection 
state of menu items only works properly if it is set *after* 
post_menu() has been called. If it is set before then, all menu items 
appear unselected. This doesn't seem to be documented anywhere that I 
can find, and it took me a while to figure out by trial and error. But 
not until after a good amount of head-scratching, and trying to figure 
out how set_item_value() could be failing without returning a failure 
code, had passed.

-- 
Adam Spragg                      mailto:address@hidden
Developer
Octal Telecom                           http://www.octaltelecom.co.uk/


It reverses the logical flow of conversation!
> Why?
> > No.
> > > Should I top post?

http://www.google.com/search?q=%22top+posting%22

Attachment: cursesmenutest.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]