Hi folks, Newbie to wxPython and the forum. I have an application
using wxStaticText and I am trying to righ align this and change the
font. The font change seems to override the right align. Simplified
code below.
thx bvd.
import wx
class Frame(wx.Frame):
def __init__(self, parent, dList):
wx.Frame.__init__(self, parent, -1, 'Alignment Test',
size=(300, 200))
panel = wx.Panel(self, -1)
panel.SetBackgroundColour("White")
# this works as expected
label = wx.StaticText(panel, wx.NewId(), ' Name', (20, 20), (150,
-1), wx.ALIGN_RIGHT)
# this does not - wx.Font seems to walk on the alignment
label2 = wx.StaticText(panel, wx.NewId(), ' Name', (20, 60),
(150, -1), wx.ALIGN_RIGHT)
label2.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL))
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.Destroy()
class App(wx.App):
def OnInit(self):
self.frame = Frame(None, 'Test')
self.frame.Show()
self.SetTopWindow(self.frame)
return True
if __name__ == '__main__':
app = App(redirect=False)
app.MainLoop()