PDA

View Full Version : Append a scroll list


nottoshabi
04-02-2009, 11:01 PM
I'm trying to append a scroll list, with a string selection. So that it displays all the objects.
So I tried this:


string $sel[] = `ls -sl`;
window;
paneLayout;
textScrollList -numberOfRows 8 -allowMultiSelection true
-append $sel ($i++)
-showIndexedItem 4;
showWindow;
And I get this error:
// Error: Invalid object or value: 14 //
The number is the size of the array plus one.

A-OC
04-02-2009, 11:13 PM
Hi, what are you trying to do by typing " $sel ($i++) " ? I don't think it's a valid syntax.

nottoshabi
04-03-2009, 12:22 AM
I'm trying to get the whole array to display its content in the window.

if you run this code
string $sel[] = `ls -sl`;

window;
paneLayout;
textScrollList -numberOfRows 8 -allowMultiSelection true
-append $sel [0] -append $sel[1]
-append $sel [2]
-showIndexedItem 4;
showWindow;

This will display the first 3 objects in the array. I want it to display all the object not just the first 3.

A-OC
04-03-2009, 12:58 AM
Then here's a quick fix:


string $sel[] = `ls -sl`;
window;
paneLayout;
textScrollList -numberOfRows 8 -allowMultiSelection true
-showIndexedItem 4 scroll_list1;

for ( $obj in $sel )
{
textScrollList -e -append $obj scroll_list1;
}

showWindow;

A-OC
04-03-2009, 01:02 AM
Does it make sense?

ewerybody
04-03-2009, 08:29 AM
btw: I recently made a test: appending directly in the for loop is way faster than creating a string that includes all -appends and then eval().

A-OC
04-03-2009, 02:46 PM
Great, didn't know that.

nottoshabi
04-03-2009, 07:48 PM
Yeah that works great thanks.

CGTalk Moderation
04-03-2009, 07:48 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.