Allingn controls wxPython

S

SMALLp

Hy. I need help. I'm using BoxSizer and i put TextCtrl and StaticText
next to each other and they gor alligned by top of TextCtrl and it looks
terrible. How can i make thm to be alligned by center of each controll.

Thnaks!
 
F

Frank Millman

Hy. I need help. I'm using BoxSizer and i put TextCtrl and StaticText
next to each other and they gor alligned by top of TextCtrl and it looks
terrible. How can i make thm to be alligned by center of each controll.

Thnaks!

Use the flag wx.ALIGN_CENTRE_VERTICAL when adding the controls to the
sizer.

If you have a number of StaticText/TextCtrl pairs, and you want them
to line up underneath each other, use a FlexGridSizer or a
GridBagSizer.

Frank Millman
 
K

kyosohma

Hy. I need help. I'm using BoxSizer and i put TextCtrl and StaticText
next to each other and they gor alligned by top of TextCtrl and it looks
terrible. How can i make thm to be alligned by center of each controll.

Thnaks!

A shortcut flag is to just use wx.CENTER. You might find this wiki
entry useful:

http://wiki.wxpython.org/UsingSizers

This article may be fruitful as well:

http://www.devshed.com/c/a/Python/A-Close-Look-at-wxPython-Controls/

I personally use the wxPython in Action book by Dunn quite a bit. It's
got lots of information, although it's not well organized.

Mike
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top