bug-ncurses
[Top][All Lists]
Advanced

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

Re: Dialog and large selection lists


From: Peter Hansson
Subject: Re: Dialog and large selection lists
Date: Fri, 14 Dec 2012 04:12:24 -0800 (PST)




Thank you for very quick answer. Some comments below.

Peter

>________________________________
> From: Thomas Dickey <address@hidden>
>To: Peter Hansson <address@hidden> 
>Cc: "address@hidden" <address@hidden> 
>Sent: Friday, December 14, 2012 12:41 PM
>Subject: Re: Dialog and large selection lists
> 
>On Fri, Dec 14, 2012 at 03:30:18AM -0800, Peter Hansson wrote:
>> Hi, 
>> 
>> I'm trying to use Dialog for some rather large selection lists (in the range 
>> 20-100 items).
>> User must select one and one only of these items.
>> 
>> For this purpose I'm using the menu widget.
>> 
>> 
>> Some things I cannot get my head around:
>> 
>> - How can I control the width of the tag within the box.  It seems to me that
>> if Dialog cannot fit the text (i.e.  tag-text + item-text) it starts chopping
>> the tag-text.  This seems unnatural to me.  Why not chop the item-text??  The
>> tag text is the unique identifier of each line in the box, right?
>
>I think you're referring to this (it chops both):
>
>    /* If the name+text is wider than the list is allowed, then truncate
>     * one or both of them.  If the name is no wider than 1/4 of the list,
>     * leave it intact.
>     */
>    use_width = (list_width - 6);
>    if (text_width >= 0
>    && name_width >= 0
>    && use_width > 0
>    && text_width + name_width > use_width) {
>    int need = (int) (0.25 * use_width);
>    if (name_width > need) {
>        int want = (int) (use_width * ((double) name_width) /
>                  (text_width + name_width));
>        name_width = (want > need) ? want : need;
>    }
>    text_width = use_width - name_width;
>    }
>
>
Yes, your're right. This corresponds to what I've witnessed.

Well, unfortunately my tag (what the C code above calls 'name') can become up 
30'ish chars.
So a feature request would be always to leave the tag string intact. 

>
>> - Can I turn off the hotkey feature??  My selections have many, many choices
>> that all start with the same letter, so the hotkey feature will be confusing
>> to the user.
>
>not currently (sounds like a feature request)


Yep !

>
>> - I need to add some kind of table heading.  This is not a problem per se as
>> I can use the menu text for that.  But how do I align it with the contents of
>> the menu box itself.  I don't have control over the actual placement of the
>> text inside the menu box and hence I cannot align the text a the top (the
>> header) with what is inside.
>
>again, a feature request ;-)
>

Yep !

If I am to predict where to put my heading I would have to use something like 
to the C code above.
That sounds a bit difficult. But I'll give it a shot.




>-- 
>Thomas E. Dickey <address@hidden>
>http://invisible-island.net
>ftp://invisible-island.net
>
>
>



reply via email to

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