Search code examples
pythontkintergridbordermargin

gridborder and -margin in Tkinter to big


I want to decrease the distance between the lines (3 and 4) in the photo. But both ipady and pady are 0 and the distance is still a lot (i want it smaller).

Code:

labeljdisk = Label(root, text="3\tLaufwerk J\t\t" + filesd['jdisk']['status'], 
                   fg=filesd['jdisk']['color'],background=bg)
labeljdisk.config(font=("Monaco", 13))
labeljdisk.grid(row=1, column=0, padx='5', pady='0', ipady='0', sticky='W')

labelstandby = Label(root, text="4\tStandbymodus\t\t" + filesd['standby']['status'], 
                     fg=filesd['standby']['color'], background=bg)
labelstandby.config(font=("Monaco", 13))
labelstandby.grid(row=2, column=0, padx='5', pady='0', ipady='0', sticky='W')

Photo:

enter image description here


Solution

  • You can save a few more pixels by setting highlightthickness and borderwidth to zero:

    labeljdisk = Label(..., bd=0, highlightthickness=0)