Insertar datos en un wxListCtrl

Horacio Degiorgi horaciod en gmail.com
Jue Ene 27 05:33:19 CET 2005


quitando wxLC_USER_TEXT (puede que en mi plataforma y version esto no
esté definido
((2, 5, 3, 1, '')  y __WXMSW__ )  en windows XP ) 
tu ejemplo funciona correctamente 
saludos 

Horaciod






On Wed, 26 Jan 2005 20:23:35 -0800 (PST), FERNANDO VILLARROEL
<fvillarroel en yahoo.com> wrote:
> 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
> 
> 
> _______________________________________________
> Python-es mailing list
> Python-es en aditel.org
> http://listas.aditel.org/listinfo/python-es
> 
> 
> 


-- 
Horacio Degiorgi
http://blog.codigophp.com




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