By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,538 Members | 1,293 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,538 IT Pros & Developers. It's quick & easy.

Tkinter radiobutton border

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Mike wrote:
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
Jul 18 '05 #2

P: n/a
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

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.