[Tkinter-discuss] experimental tk program in python3

Michael Lange klappnase at web.de
Fri Dec 17 13:49:34 CET 2010


Hi,

Thus spoketh python at bdurham.com 
unto us on Thu, 16 Dec 2010 18:07:27 -0500:

> Dave,
> 
> Works in Python 2.7 by changing import statements to:
> 
> from Tkinter import *
> import ttk
> 
> Is there a way to change a frame's border color? (I think this is a
> Tkinter limitation, but I'd love to be proven wrong<g>)
> 

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):

#############################
from Tkinter import *

root = Tk()
f = Frame(root, bg='white', highlightthickness=2,
highlightbackground='red', width=200, height=200) f.pack(padx=100,
pady=100, fill='both', expand=1)

root.mainloop()
############################



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

You're too beautiful to ignore.  Too much woman.
		-- Kirk to Yeoman Rand, "The Enemy Within", stardate
                   unknown


More information about the Tkinter-discuss mailing list