python - borders in tkinter not getting displayed -


i writing small program in python grid effect wherin each grid label.

below code:

from tkinter import *  root = tk() root.configure(bg='black')  frame = frame( bg='red') frame.pack()  heading=["source","name","code","identity","source","name","code","identity"] r1=[1,2,3,4,5,6,7,8] r=0 c=0 k in range(0,5):     in  heading:         lab = label (frame,text = i,bg='cyan',padx='3.0m', pady='3.0m')          lab.grid(row=r,column=c)         c = c+1     r=r+1     c=0  root.mainloop() 

i cannot border of labels set. please specify attribute should incorporate, i've tried using border width without success.

you can't border of labels set, don't see anywhere in code you've defined border labels.

if want borders on actual label widgets, use borderwidth , relief options:

lab = label (..., borderwidth=1, relief="solid" 

if, instead of border on widget, want space between each widget background shows through, use padx , pady options when use grid:

lab.grid(..., padx=1, pady=1) 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -