PDA

View Full Version : Maxscript--Question about " items:("","") "


BebeteLANUITE
01-19-2006, 02:41 PM
Hello folks !

I have a question about the "items" parameter.
I want to refresh a listbox after clicking on a button. But i don't know if "items:" in
-- Listbox listb "List :" items: -- is use only on creating the listbox or can be edited later.

I put a for loop in the items like

-- items:(for f in 1 to objects collect f.length) --

That works the for loop get lengthes and put them in the listbox. But if i create a new box how to refresh the list to have the length of the new box too ?

Could you help me ?

HalfVector
01-19-2006, 02:46 PM
There's a "how to" example in the MAXScript reference titled "How do I update the items in a dropdownList or listBox?" that explain exactly what you are looking for. Here's a snip of code:

--Because insertItem returns OK instead of the resulting array,
--you cannot assign the result of the expression directly to the property.
--Instead, you have to get a copy of the items array in a local variable...
temp_array = testList.items
--...perform the insertion with the temp. array in the local variable...
insertItem ("Item "+ (testList.items.count+1) as string) temp_array testList.selection
--...and assign back the temp. array to the .items property
testList.items = temp_array

Hope that helps.

BebeteLANUITE
01-19-2006, 02:51 PM
Hello Halfvector.

I don't believe it.
I have the maxscript reference open and i didn't see it :p.

Thanks a lot for your help. :buttrock:

HalfVector
01-19-2006, 02:55 PM
Yeah, sometimes is hard to find what you are looking for! ;)

BebeteLANUITE
01-19-2006, 02:56 PM
Oh yes i found it.

Maxscript it's a big book with a lot of pages very very hidden.
I don't understand why they don't put this "how to" in how to list. Very strange :curious:

BebeteLANUITE
01-19-2006, 02:59 PM
No it's not a "how to" but a "how do".
There is the explication :p

Bobo
01-19-2006, 11:30 PM
Oh yes i found it.

Maxscript it's a big book with a lot of pages very very hidden.
I don't understand why they don't put this "how to" in how to list. Very strange :curious:


My bad.

Back in R5 when I started editing the Reference, I added a bunch of Tutorials under the chapter "How To... Practical Examples".

Then in a later update, I added a Frequently Asked Questions chapter and in order to avoid mixing the How To tutorials with the FAQ, most of the FAQ entries were named "How Do I...".

In general, I would suggest reading ALL FAQ entries, even if you don't need them today. This will give you an idea what FAQs have been asked and answered and next time you need a common workaround or specific detail, you will probably remember vaguely reading about it and will look again.

In the mean time, I will make sure that ALL FAQs are back-linked from the topics they relate to...

BebeteLANUITE
01-20-2006, 06:59 AM
Hello Borislav.

Thanks for your suggestion. i'll make it. ;)
It's my fault because i am totally lost in mascript reference. I don't know why :p
i can't read it properly.

I don't know you have write it :)

CGTalk Moderation
01-20-2006, 06:59 AM
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.