Insertar datos en un wxListCtrl

FERNANDO VILLARROEL fvillarroel en yahoo.com
Jue Ene 27 05:23:35 CET 2005


Hola no logro insertar datos en un listctrl, en el
siguiente codigo consigo crear la columna, pero la
lista de datos no;

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|wxLC_USER_TEXT )
        self.list.InsertColumn( 0, 'HOLA' )
        for i in range( 10 ):
            self.list.InsertStringItem(i, 'Que Tal' )
        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()

Que ocurre por que no se ven los datos insertados.

Luego tambien me interesa saber como eliminar un item
seleccionado de la lista.

Fernando Villarroel.


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail
------------ 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