Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Blocks of strings in text-lists.

 [1/6] from: carl::cybercraft::co::nz at: 6-May-2002 19:40


A text-list can be given blocks of strings, which is nice and useful. ie... view layout [text-list data [["aa " "bb"]["cc " "dd"]]] But does text-list allow you to tab the strings in the lines? -- Carl Read

 [2/6] from: anton:lexicon at: 6-May-2002 21:05


How about this? view layout [text-list data [["aaaaa" "^-bb"]["cc" "^-dd"]]] Anton.

 [3/6] from: jason:cunliffe:verizon at: 6-May-2002 8:34


> How about this? > > view layout [text-list data [["aaaaa" "^-bb"]["cc" "^-dd"]]]
Nice. How do you suggest to set/align the TABS when there are long words? For example:
>> view layout [text-list 600x400 data [["aaaaa"
^-^-one^-^-bb ]["this_is_a_very_long_file name.tst" "^-^-two^-^-cc"]]] ./Jason

 [4/6] from: greggirwin:mindspring at: 6-May-2002 9:38


Hi Jason, <<
> How about this? > > view layout [text-list data [["aaaaa" "^-bb"]["cc" "^-dd"]]]
How do you suggest to set/align the TABS when there are long words?
>>
That can be a bit of work with proportional fonts. If you just count chars and spaces, it's not so bad. You just decide at what "position" the tabs should fall, subtract the length of the leading string, and pad accordingly. A "smart tab" feature would look at all the items in the list and find the longest one, using that as a guide. You could think of it like padding with spaces, but tabs count for n spaces, instead of one. --Gregg

 [5/6] from: carl:cybercraft at: 7-May-2002 19:12


On 07-May-02, Gregg Irwin wrote:
> Hi Jason, > <<
<<quoted lines omitted: 11>>
> You could think of it like padding with spaces, but tabs count for n > spaces, instead of one.
First up, thanks to Anton for the suggestion to put tab-characters in the string. (blush:) Is it you Gregg who says we tend to look for the hard way to do things too often? As to Jason's question, you use 'para to set the tabs to the positions you want. (Just looked it up.) ie... view layout [ text-list para [tabs: [20 40 110 150]] data [ ["a" "^-b" "^-c" "^-d" "^-e"] ["1" "^-2" "^-3" "^-4" "^-5"] ] ] As Gregg said, you'd need to measure the strings if you want to set the tabs based on their lengths. See the recent "Proportional-spaced fonts with accent marks" thread for a discussion on measuring the pixel-length of strings. -- Carl Read

 [6/6] from: anton:lexicon at: 8-May-2002 11:06


Try investigate this: system/console/tab-size Defaults to value 4. I would: - save the current tab value - determine the maximum filename length - set the tab value greater than the maximum - display your text-list - restore the tab value afterwards You could also specify a fixed-width font: view layout [ text-list data ["iiii" "AAAA" "----"] with [ font: [name: font-fixed size: 40] ] ] view layout [ text-list data ["iiii" "AAAA" "----"] font-name font-fixed ] I just went to the View Developer's Guide for this info. Anton.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted