hi,

how do I left justify all the radiobutton displayed?

For example, I have 5 radio button with different text, each on different row using:

rb[i].grid(row=i, column=0)

Instead of displaying it left justified, its all centered.

I tried using anchor='w', but result the same.

I tried also to count the text length of each radiobutton and filling the text with spaces on the right so it all has the same length, which 'almost' work, but it seems that each character have different width.

If the radiobutton can't be left justified, what font can I use that have the same width for all character?

Thanks

Recommended Answers

All 4 Replies

Additional Note:

Searching with google, I found out that fonts with same width are called Monospaced Fonts.

Example of monospaced fonts:
Courier, Monaco, Fixedsys

Found a nice site about monospaced fonts for programmers:
http://www.kuro5hin.org/story/2004/12/6/11739/5249


So, the radiobutton problem can be 'tickled' by using monospaced fonts. But still, I would know if there is a way to do it with Tkinter by setting its attribute, instead of going around it with filling spaces to the text?

Courier is the most common font to space all character equal.

commented: Nice and direct solution! +1

Grid does not have anchor, but it has sticky:

rb[i].grid(row=i, column=0, sticky='w')

whoa!! thanks a lot..

You saved my day! (Those are not so beautiful fonts, and now I dont need to use them)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.