From 728a04401b950c71d5c5831e2d6eab994c1e3e3d Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Mon, 14 Oct 2002 21:48:26 +0000 Subject: [PATCH] make copy of items list if all strings --- direct/src/gui/DirectScrolledList.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/direct/src/gui/DirectScrolledList.py b/direct/src/gui/DirectScrolledList.py index 522e773459..f4dfb68b88 100644 --- a/direct/src/gui/DirectScrolledList.py +++ b/direct/src/gui/DirectScrolledList.py @@ -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 = (