Insertar Items en Columnas wxListCtrl

FERNANDO VILLARROEL fvillarroel en yahoo.com
Jue Ene 27 15:24:49 CET 2005


Siguiendo este ejemplo como hago para insertar un item
que contenga el nombre y la edad en cada columna
respectivamente.

from wxPython.wx import *
class MyFrame ( wxFrame ):
    def __init__ ( self, parent ):
        wxFrame.__init__( self, parent, 1, 'Test',
size = (200, 300) )
        self.list = wxListCtrl( self, 2,
style=wxLC_REPORT|wxLC_SINGLE_SEL)
        self.list.InsertColumn( 0, 'Nombre' )
        self.list.InsertColumn( 1, 'Edad' )
        for i in range( 10 ):
            self.list.InsertStringItem(i, 'Fernando' )
        EVT_LIST_GET_INFO(self.list,2,self.OnListInfo)
        self.Center()
        self.Show( true )
    def OnListInfo( self, event ):
        item = event.GetItem()
        item.m_text = 'HOla'
class MyApp ( wxApp ):
    def OnInit ( self ):
        self.frame = MyFrame( None )
        self.SetTopWindow( self.frame )
        self.frame.Raise()
        return true
def run():
    app = MyApp( 0 )
    app.MainLoop()
    del app
if __name__ == "__main__":
    run()

Esto me llena solo la columna nombre, pero no doy con
el metodo que me permita insertar tanto el nombre como
la edad.



		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 

------------ próxima parte ------------
_______________________________________________
Python-es mailing list
Python-es en aditel.org
http://listas.aditel.org/listinfo/python-es


Más información sobre la lista de distribución Python-es