Problem with text alignment

A

alejandro

I can't align the text on the right in my wxDialog.
Everything else works fine


self.sirina = wx.StaticText(self,-1,'',(200,50),style=wx.ALIGN_RIGHT)
 
A

alejandro

Here is the whole dialog:

class OpcijeFolija(wx.Dialog):
def __init__(self, parent, id, title):
wx.Dialog.__init__(self,parent, id, title, size=(300,300))
foli=cPickle.load(file("folije.data"))
#-------------------------- dropdown
self.combo = wx.ComboBox(self, 10, pos=(20,20), size=(150,-1),
choices=foli,style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnSelect, id=10)

#--------------------------text
wx.StaticText(self,-1,'Sirina role',(20,50))
wx.StaticText(self,-1,'Naziv folije',(20,80))
wx.StaticText(self,-1,'Cijena po duznom metru',(20,110))
#--------------------------text izmjenjivi
self.sirina =
wx.StaticText(self,-1,'',(200,50),style=wx.ALIGN_RIGHT)
self.ime = wx.StaticText(self,-1,'',(200,80),style=wx.ALIGN_RIGHT)
self.cina = wx.StaticText(self,-1,'',(200,110),style=wx.ALIGN_RIGHT)

self.Centre()

#-------------------------- botuni
wx.Button(self,1,'Novi unos',(20,200), size=(80,20))
wx.Button(self, 2,'Izbrisi',(110,200), size=(80,20))
wx.Button(self, 3, 'Zatvori',(200,200),size=(80,20))
self.Bind(wx.EVT_BUTTON, self.OnClose, id=3)

def OnClose(self, event):
self.Close()

def OnSelect(self, event):
redBr = self.combo.GetCurrentSelection()
sirinaFajl = cPickle.load(file("sirina.data"))
imeFajl = cPickle.load(file("folije.data"))
cijenaDuzinaFajl = cPickle.load(file("duzina.data"))

self.sirina.SetLabel(str(sirinaFajl[redBr]))
self.ime.SetLabel(str(imeFajl[redBr]))
self.cina.SetLabel(str(cijenaDuzinaFajl[redBr]))
 
G

Gabriel Genellina

En Wed, 04 Mar 2009 06:14:41 -0200, alejandro
I can't align the text on the right in my wxDialog.
Everything else works fine


self.sirina = wx.StaticText(self,-1,'',(200,50),style=wx.ALIGN_RIGHT)

In case there is a misunderstanding, ALIGN_RIGHT means that the text
itself is right aligned inside the widget, not that the widget is placed
against the right border of its container.
 
A

alejandro

#----------------- this would be an example, the reason I didnt understand
is that I used just one line of text





I understand now. Can I align it on the right withot using sizers?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top