Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get rid of extra widget borders on Tk Linux!

Status
Not open for further replies.

Kirsle

Programmer
Joined
Jan 21, 2006
Messages
1,179
Location
US
Okay, so there's always been this little annoyance on Linux's Perl Tk that I just couldn't seem to get rid of. And that is...

Most widgets (namely, Entry, Button, Checkbutton, Radiobutton, etc) would have extra borders around them. This extra border is normally the same color as the default window background, and therefore is only noticeable when you change the window background.

Here's a screenshot for demonstration:
highlight.png


I was almost going to go as far as to program my own Tk widgets as replacements to these defaults *just* to overcome this little annoyance.

But then I discovered a lil trick to fix the problem and just about punched myself in the face at how simple it was!

Simply use the following options when configuring your widget...

Code:
-highlightbackground
   The color of that border when it doesn't have focus

-highlightcolor
   The color when it does have focus

-highlightthickness
   The thickness of the border (0 = get rid of it completely!)

So, I just thought I'd post this here for anyone else who might've been having the same problem as me. :)

highlightthickness.png


-------------
Cuvou.com | The NEW Kirsle.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top