Reputation: 492
I follow the tutorials online and the documentations but still can't add a border to a frame. The following is the code I run
import tkinter as tk
root = tk.Tk()
frame1 = tk.Frame(root, borderwidth=2 )
frame2 = tk.Frame(root, borderwidth=2 )
frame1.grid(row = 0)
frame2.grid(row = 1)
tk.Label(frame1, text = 'frame1').grid(row = 0)
tk.Label(frame2, text = 'frame2').grid(row = 0)
root.mainloop()
And this is the result I got. What's the problem?
Upvotes: 0
Views: 115
Reputation: 385890
You need to set the relief
option to one of "raised", "sunken", "ridge", or "groove". On your system it appears the default is "flat". The final option is "solid".
Upvotes: 1