Welcome, guest | Sign In | My Account | Store | Cart

This trick show how to add a border color to frame. These are the important configurations:

 highlightbackground="your border color here"
 highlightcolor="your border color here"
 highlightthickness="the border width"
 bd= 0

Don't have Python Installed?

Install Python along with this recipe!

After Installation

  1. Edit the recipe.py file to modify the recipe.
  2. Run state run recipe to run the recipe and see your changes.
Python, 21 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
try:
    from Tkinter import Frame, Entry, Tk
except ImportError:
    from tkinter import Frame, Entry, Tk
    

root = Tk()
frame1 = Frame(root, highlightbackground="green", highlightcolor="green", highlightthickness=1, width=100, height=100, bd= 0)
frame1.pack()
frame1.pack_propagate(False)

Entry(frame1).pack()


frame2 = Frame(root, highlightbackground="red", highlightcolor="red", highlightthickness=1, width=100, height=100, bd= 0)
frame2.pack()
frame2.pack_propagate(False)

Entry(frame2).pack()

root.mainloop()