make copy of items list if all strings

This commit is contained in:
Darren Ranalli 2002-10-14 21:48:26 +00:00
parent 86cff9ab51
commit 728a04401b
1 changed files with 11 additions and 0 deletions

View File

@ -13,6 +13,17 @@ class DirectScrolledList(DirectFrame):
# and when that item is needed, itemMakeFunction will be called
# with the text, the index, and itemMakeExtraArgs. If itemMakeFunction
# is not specified, it will create a DirectFrame with the text.
# if 'items' is a list of strings, make a copy for our use
# so we can modify it without mangling the user's list
if kw.has_key('items'):
for item in kw['items']:
if type(item) != type(''):
break
else:
# we get here if every item in 'items' is a string
# make a copy
kw['items'] = kw['items'][:]
# Inherits from DirectFrame
optiondefs = (