Tkinter radiobutton border

M

Mike

I've placed a radiobutton on a green panel. The background of the
radiobutton is also green. Borderwidth is 0 and relief is FLAT. I
still get a thin gray border around the radiobutton. What is this
border, and how can I get rid of it. Thanks.

Mike
 
P

Peter Otten

Mike said:
I've placed a radiobutton on a green panel. The background of the
radiobutton is also green. Borderwidth is 0 and relief is FLAT. I
still get a thin gray border around the radiobutton. What is this
border, and how can I get rid of it. Thanks.

Try

highlightthickness=0

Peter
 
J

Jeff Epler

Peter Otten's advice is correct, if all you want to do is get rid of
this 1-pixel area. However, you may want to use highlightbackground to
set it to green, so that the visual cue for "this widget has keyboard
focus" is retained.

To explain a little more, every widget has a "highlight rectangle"
around it, which has a thickness of highlightthickness and a color of
either highlightcolor (if the widget or a child has focus), or
highlightbackground (otherwise).

A few widgets may actually behave differently (buttons on win32 display
a dotted rectangle between the border and the contents, for instance).
Widgets that don't normally take focus (such as frames and labels) have
a 0 highlightthickness by default, but can be given a highlightthickness.

Widgets that tend to take keyboard focus default to a highlight
thickness of 1, with back for highlightcolor and the system background
color for highlightbackground. This is why I suggest that you consider
setting the highlightbackground to green.

If you create a scrolled area, you may want to set the
highlightthickness of the scrolled widget to 0, and that of the frame
that encloses it and the scrollbars to 1. This will make the focus
rectangle surround the scrolled widget and the scrollbars together.

Jeff
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top