pass textScrollList to proc

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 02 February 2013   #1
pass textScrollList to proc

Hi everyone, I'm curious if I can pass a textScrollList name to a procedure, so i can populate multiple lists with the same proc

textScrollList -ams 1 -p someParent myListName;

global proc populateList($listname, string $listItems[])
     textScrollList -edit $listName;

     for($listItem in $listItems)
          textScrollList -edit -append $listItem $listName;
//trying to use something like this doesn't work
populateList("myListName", $arrayOfElemenets);

Old 02 February 2013   #2
I don't see why it shouldn't.

Though when you state "it doesn't work", that is a rather vague statement.
Old 02 February 2013   #3

global proc populateList(string $listName, string $listItems[]) 
   textScrollList -edit $listName; 

   for($listItem in $listItems) 
       textScrollList -edit -append $listItem $listName; 

strange, it works now, I guess it's because I forgot to add string to $listName in my proc declaration.
Old 02 February 2013   #4
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:07 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.