Hi,
Thus spoketh [email protected]
unto us on Fri, 17 Dec 2010 08:41:45 -0500:
> Hi Michael,
>
> > For widgets that don't accept keyboard focus you can use the
> > highlightbackground option to create a colored border (although you
> > cannot add a "3D"-relief this way) ... <snipped>
>
> I took your example and added another frame and widgets that gain focus.
> Your highlightbackground suggestion only works when there's a single
> frame without widgets that can gain focus themselves. Interesting: On my
> machine, the highlightbackground appears to work the opposite of its
> stated purpose, eg. when button2 has focus, frame 1 shows its
> highlightbackground and vice-versa.
>
Oh yes, I failed to check this properly; you can fix this by additionally
setting the highlightcolor though:
##########################
from Tkinter import *
root = Tk()
f1 = Frame(root, bg='white', highlightthickness=2, highlightbackground='red',
highlightcolor='red', width=200, height=200)
f1.pack(padx=100, pady=100, fill='both', expand=1)
Button( f1, text='Button 1' ).pack()
f2 = Frame(root, bg='white', highlightthickness=2, highlightbackground='green',
width=200, height=200)
f2.pack(padx=100, pady=100, fill='both', expand=1)
Button( f2, text='Button 2' ).pack()
root.mainloop()
##########################
Regards
Michael
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
Another war ... must it always be so? How many comrades have we lost
in this way? ... Obedience. Duty. Death, and more death ...
-- Romulan Commander, "Balance of Terror", stardate 1709.2
_______________________________________________
Tkinter-discuss mailing list
[email protected]
http://mail.python.org/mailman/listinfo/tkinter-discuss