tags:

views:

38

answers:

1

Hi, I'm searching for help about lists in pgu gui for pygame. I need to know which methods and properties they have, so I can include them in my programs

A: 

My first suggestion

Use python's builtins to introspect on

import pgu.gui.List
import inspect
help(pgu.gui.List) # to read out the doc strings
print dir(pgu.gui.List) # to get the namespace of List class
# to get all methods of that class
all_functions = inspect.getmembers(pgu.gui.List, inspect.isfunction) 

Always look at the source code, when it is available

From the code: You can create and clear a list.

class List(ScrollArea):
    """A list of items in an area.

    <p>This widget can be a form element, it has a value set to whatever item is selected.</p>

    <pre>List(width,height)</pre>
    """
    ....
    def clear(self):
        """Clear the list.

        <pre>List.clear()</pre>
        """
        ...

Usage :

# Create the actual widget
    usagelist = gui.List(width, height)
pyfunc