Center a text : StaticText : WxPython PYTHON TUTORIALS


PYTHON TUTORIALS » WxPython » StaticText »

 

Center a text


Center a text
import wx

class StaticTextFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1'Static Text Example', size=(400300))
        panel = wx.Panel(self, -1)
        wx.StaticText(panel, -1"This is an example of static text"(10010))
        center = wx.StaticText(panel, -1"align center"(10050)(160, -1), wx.ALIGN_CENTER)
        center.SetForegroundColour('white')
        center.SetBackgroundColour('black')

app = wx.PySimpleApp()
frame = StaticTextFrame()
frame.Show()
app.MainLoop()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo WxPython
» StaticText