bug-ncurses
[Top][All Lists]
Advanced

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

Re: Using leading blank instead of periods.


From: Peter Hansson
Subject: Re: Using leading blank instead of periods.
Date: Tue, 18 Dec 2012 06:38:14 -0800 (PST)

Hi Michael,

Thank you for all your input. The idea of using a leading space to get rid of 
the hotkey 
feature is a nice workaround and certainly something that can be used until such
time where Dialog will (hopefully) have a switch that can turn off the hotkey 
feature.



I've put together this example to show what I mean regarding those other issues:

#!/bin/bash

mytmp="/tmp/diatmp"
rm $mytmp

echo "\" internal/house/customers/abc\""             "\"online        
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" internal/house/customers/abcdefgh\""        "\"online        
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" internal/offsite/customers/abc\""           "\"unknown       
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" external/house/customers/abcd\""            "\"offline       
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" external/house/customers/abcde\""           "\"offline       
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" external/house/customers/abcdef\""          "\"offline       
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" external/house/customers/abcdefg\""         "\"offline       
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" external/house/customers/abcdefgh\""        "\"offline       
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" external/house/customers/abcdefghi\""       "\"maintenance   
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" external/house/customers/abcdefghij\""      "\"offline       
2012-06-12   Some description, long, long, stops here\"" >> $mytmp
echo "\" external/house/customers/abcdefghijk\""     "\"offline       
2012-06-12   Some description, long, long, stops here\"" >> $mytmp

dialog --clear --backtitle "Node Management" --title "Nodes" "$@"  
--no-collapse \
        --menu "  NODENAME                                STATE          TIME   
 DESC" \
           0 0 0  \
          --file $mytmp
# end


First off all you'll notice that the tag-text gets chopped. This leaves the 
user in a situation where he cannot 
distinguish between the items on the list. Secondly note how I cannot really 
place the column header. I'm not
too fond of the idea of having the table header as the first item on the list. 
For one thing it will quickly scroll
off the list.

I would think I can get around the placing-of-the-header issue if I knew the 
user's terminal would be exactly x
columns. I'm sure there's a way I can force that. However the chopping of the 
tag-text is worse.

I haven't tested this with a radiolist widget. I suppose Dialog's chopping 
algorithm applies to both types
of widgets (radiolist and menu).

One solution I can think of would be to measure the terminal width before 
Dialog is called and then use that
to manually chop off from the description text BEFORE I even feed it into 
Dialog. This way Dialog's chopping
algorithm would never kick in. All I want is for chopping to always happen from 
the right hand side only.

But is is quite a lot of workarounds for something that - IMHO - should be a 
common case. However with your
help I'm beginning to see solutions/workarounds rather than 
this-can-never-be-done-and-I'm-giving-up.  :-)

Cheers

Peter





----- Original Message -----
> From: Michael D. Setzer II <address@hidden>
> To: Peter Hansson <address@hidden>; address@hidden
> Cc: 
> Sent: Tuesday, December 18, 2012 2:24 PM
> Subject: Using leading blank instead of periods.
> 
> Using quotes around text allows for a leading blank that gets rid of 
> the highlighting, but still loses the space.
> 
> #!/bin/bash
> echo "dialog --radiolist \"text\" 0 0 0 \\" 
>> testdialog
> echo \" TEXT OPTION\" \"COL1 COL2 COL3\" 
> "off" \\ >>testdialog
> for a in `ls | grep -v \ | grep -v \&` 
> do 
>   echo \" $a\" \"col1 col2 col3\" 
> "off" \\  >>testdialog 
> done
> echo "2>result.out" >>testdialog
> gedit testdialog
> ./testdialog
> gedit result.out
> 
> +----------------------------------------------------------+
>   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
>



reply via email to

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