| | |
Radiobutton with Tkinter
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Aug 2009
Posts: 27
Reputation:
Solved Threads: 1
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:
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
how do I left justify all the radiobutton displayed?
For example, I have 5 radio button with different text, each on different row using:
Python Syntax (Toggle Plain Text)
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
•
•
Join Date: Aug 2009
Posts: 27
Reputation:
Solved Threads: 1
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?
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?
Grid does not have anchor, but it has sticky:
Python Syntax (Toggle Plain Text)
rb[i].grid(row=i, column=0, sticky='w')
No one died when Clinton lied.
![]() |
Similar Threads
- XML gui Tkinter (Python)
- [Tkinter] radiobutton.deselect() problem (Python)
- tkinter Listbox question (Python)
- Radio button help (using Tkinter with Python) (Python)
- Tkinter LCD sub-pixel rendering in Ubuntu (Python)
- Python GUI Problem (Python)
- Radiobutton text placement (Python)
Other Threads in the Python Forum
- Previous Thread: If / Else Statement Help
- Next Thread: Easy Question (For You)
| Thread Tools | Search this Thread |
alarm assignment avogadro beginner bluetooth character cmd code customdialog cx-freeze data decimals dictionary directory dynamic error examples excel exe file float font format function generator gnu graphics gui halp homework http ideas import input itunes java leftmouse line linux list lists logging loop maintain maze module mouse number numbers output parsing path port prime programming projects push py2exe pygame pyglet pyqt python queue random recursion schedule screensaverloopinactive script scrolledtext slicenotation sqlite ssh stdout string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode urllib urllib2 variable ventrilo verify vigenere web webservice wikipedia windows wxpython xlib






