On 4/15/06, James Edward Gray II <james / grayproductions.net> wrote:
> I'm not very clear on what feature you are requesting.
>
> If it is word wrap, HighLine already does this (see the wrap
> parameter to the constructor). If you are instead trying to pad list
> items, just run through your Array before handing it off, calling
> String#ljust/center/rjust.
>
> If I am still way off, try explaining again the feature you are
> requesting. Maybe without the code this time, because I think that
> funny Array is confusing me...
It feels like HighLine can do this columnizing but I'm not using it right.
Let's imagine I have an array which has a short string of text and
then a long string of text.
a = ["a short line_", "A long line of text which should wrap"]
Imagine that the second element ( a[1] ) could be very long and would
not display well on my very thin screen / xterm. Normally, if I
outputted one element after the other it would look like this:
print a[0], a[1]
=>
a short line_A long line of text
which should wrap
(imagine my screen is thin)
The long line of text wraps on the second line, starting at the far
left. I want it to instead look like this:
a short line_A long line of text
which should wrap
(imagine my screen is thin)
----
so the left-hand column is:
a short line_
and the right-hand column is
A long line of text
which should wrap
----
I've played and played but I am very green and still don't understand
how to do most things. Looking at code really helps if it's simple
enough.