2010-10-29 104 views
0

我正在寻找关于pyguame中pgu gui列表的帮助。我需要知道他们有哪些方法和属性,所以我可以将它们包含在我的程序pgu/pygame中的列表

+0

请问我的回答可以帮助您? – pyfunc 2010-10-29 21:48:08

+0

感谢您的回答,pyfunc。我确实分析了这些示例,但是当我导入pgu.gui.List时,我得到:没有名为pgu.gui.List的模块 – Carlos 2010-11-01 19:28:48

回答

0

我的第一个建议

使用Python的内建对

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) 

反思总是看源代码,当它可用时

从代码:您可以创建并清除列表。

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> 
     """ 
     ... 

用法:

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

感谢您的回答,pyfunc。我确实分析了这些示例,但是当我导入pgu.gui.List时,我得到:没有名为pgu.gui.List的模块 – Carlos 2010-11-01 10:50:39