[Python-es] Dudas de centrado de texto

Gonzalo Mouriÿfffffffffff1o Pardo gmourinopardo en yahoo.es
Mie Oct 10 14:43:50 CEST 2012


Buenas tardes, tengo otra duda:
Necesito centrar un wx.Statictext (tc1) en la pantalla, pero al tenenr una fuente asociada no puedo como lo hago, gracias.
 
import wx
 
class Ventana(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, 'Static Text Example', size=(800, 300)
                          )
        panel = wx.Panel(self, -1)
        font = wx.Font(16, wx.DECORATIVE, wx.ITALIC, wx.NORMAL)
        tc1 = wx.StaticText(panel, -1, "Texto de prueba", (100, 70), (600, -1), wx.ALIGN_CENTER)
        tc1.SetForegroundColour('white')
        tc1.SetBackgroundColour('black')
        tc1.SetFont(font)
        tc2 = wx.StaticText(panel, -1, "Segunda linea", (100, 110), (600, -1), wx.ALIGN_CENTER)
        tc2.SetForegroundColour('white')
        tc2.SetBackgroundColour('black')

if __name__ == '__main__':
    app = wx.App()
    frame = Ventana()
    frame.Show()
    app.MainLoop()
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://mail.python.org/pipermail/python-es/attachments/20121010/e243bfc4/attachment.html>


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