[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dialog and large selection lists
From: |
Michael D. Setzer II |
Subject: |
Re: Dialog and large selection lists |
Date: |
Tue, 18 Dec 2012 21:18:48 +1000 |
On 14 Dec 2012 at 3:30, Peter Hansson wrote:
Date sent: Fri, 14 Dec 2012 03:30:18 -0800 (PST)
From: Peter Hansson <address@hidden>
Subject: Dialog and large selection lists
To: "address@hidden" <address@hidden>
Send reply to: Peter Hansson <address@hidden>
the GNU implementation of curses" <bug-ncurses.gnu.org>
<mailto:address@hidden>
<mailto:address@hidden>
> 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?
>
> - 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.
>
> - 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.
>
>
> I hope you can assist with some good ideas on this.
>
> Thx.
>
> Peter
Perhaps I am not getting what you want, but just did a little test
using the file names in a directory as the input for the list.
#!/bin/bash
echo "dialog --radiolist \"text\" 0 0 0 \\" >testdialog
for a in `ls | grep -v \ | grep -v \&`
do
echo $a "select" "off" \\ >>testdialog
done
echo "2>result.out" >>testdialog
gedit testdialog
./testdialog
gedit result.out
This creates the testdialog script that contains over 500+ lines in
the directory I used. Had issues with filenames with " "'s or &'s in
them, so filtered those out. Just used select as the second text,
and set all to off.
When it runs the testdialog script, it shows all the file names, and I
can select the one I want, and the result is placed in the result.out
file.
What form do you have the 20-100 items, and do they have
spaces or special characters.
>
>
>
+----------------------------------------------------------+
Michael D. Setzer II - Computer Science Instructor
Guam Community College Computer Center
mailto:address@hidden
mailto:address@hidden
http://www.guam.net/home/mikes
Guam - Where America's Day Begins
G4L Disk Imaging Project maintainer
http://sourceforge.net/projects/g4l/
+----------------------------------------------------------+
http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned: 19,471
Processing time: 32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)
address@hidden CREDITS
SETI 13471758.391615 | EINSTEIN 9375439.209852
ROSETTA 5601813.107505 | ABC 15592097.439004