textMayChange is an optimization. Its use to is to specify that the “text” member of a DirectGUI object might later be reset to some other string, allowing Panda to optimize the text object if it will never change after its creation. This is true for all DirectGUI objects, although some objects (like DirectEntry) don’t make use of a “text” member, so it doesn’t have a lot of value for these objects.
The DirectScrolledList will create buttons that, when clicked, will scroll the list up and down automatically, by the number of items specified in scrollSpeed. These buttons are called incButton and decButton, and their properties are specified like incButton_relief = RAISED, incButton_pos = (0.0, 0.0, -0.316), incButton_text = ‘Up’, etc.
itemMakeFunction, if defined, is called to create each item of the DirectScrolledList. It is passed the parameters (item, i, self[‘itemMakeExtraArgs’])), where item is the supplied element, i is the index, and self[‘itemMakeExtraArgs’] is whatever was passed as itemMakeExtraArgs. It should return a DirectGUI item of some kind. This function is only called when the item list is a list of strings.
If the item list is a list of strings and itemMakeFunction is not defined, then a DirectLabel is created for each item.
If the item list is not a list of strings, it is assumed to be a list of DirectGUI items. In this case itemMakeFunction is not used.
You should not pass a tuple to the items member. You should pass a list instead, e.g. [‘abc’, ‘def’], instead of (‘abc’, ‘def’). That is why you are getting the message “AttributeError: ‘tuple’ object has no attribute ‘append’”.
The DirectScrolledList’s command is called whenever the list is scrolled by the user.
makeAllItems calls the itemMakeFunction (or creates a DirectLabel) for every item on the list. It is useful only when you pass in a list of strings for the items. The DirectScrolledList normally uses lazy creation of these items; it does not create the items until they are actually rendered. This allows you to create a DirectScrolledList with thousands of string elements and not have to wait for them all to be created up front. Not sure if there’s any real reason to call makeAllItems() in practice.
Usually, item is a new item, either a string or a DirectGUI element (as described above), and itemID is an arbitrary identification number for each item (but not necessarily a zero-based index number). The itemID for a new item is the return value of addItem().
David