Hola:

En 2011/02/14 19:25, Oswaldo Hernández escribiu:
El 14/02/2011 17:03, damufo escribió:
...
Haciendo alguna prueba he descubierto un truco que en principio parece
que funciona, pero si utilizas, hazlo con precaución, ya que no lo he
visto documentado en ningún sitio y desconozco si puede tener algún
efecto secundario:

class CellRenderer(Grid.PyGridCellRenderer):
def Draw(self, grid, attr, dc, rect, row, col, isSelected):
# ejecuar renderizador de strings
Grid.GridCellStringRenderer().Draw(grid, attr, dc, rect, row, col,
isSelected)
# Agregar parte personalizada
dc.SetPen( wx.Pen(wx.Colour( 255, 0, 0 ) , 1, wx.SOLID))
dc.DrawLine( rect.x + rect.width-1, rect.y, rect.x + rect.width-1,
rect.y + rect.height)
...

Justo esto de arriba era lo que estaba buscando y parece que funciona
tal como quería.

Como no estaba del todo seguro sobre la "legalidad" de usar de esta forma el renderizador he hecho una consulta y esta ha sido la respuesta:

I think that in this case it is probably alright since creating a new instance of the renderer is fairly lightweight and doesn't create any UI objects.

Robin Dunn
Software Craftsman
http://wxPython.org

Mi inglés no sea muy bueno que se diga, pero si no entiendo mal es correcta tú solución.
Con nueva instancia supongo que se refiere a esta línea:
Grid.GridCellStringRenderer().Draw(grid, attr, dc, rect, row, col,
isSelected)
Por favor, corrígeme si me equivoco.


Saludos y gracias.
_______________________________________________
Python-es mailing list
Python-es@python.org
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a