I have the following code:
from Tkinter import *
def gui():
root = Tk()
root.configure(background = 'red')
rightPanel = PanedWindow(borderwidth=0, bg='black')
rightPanel.pack(side = 'right', fill=BOTH, expand=1)
canvas1 = Canvas(rightPanel, bg='black')
rightlabel = Label(canvas1, bg= 'grey')
rightlabel.place(relx=0.5, rely=0.5, anchor=CENTER)
canvas1.pack(fill=BOTH, expand=1)
root.wm_attributes('-topmost', 1)
mainloop()
if __name__ =='__main__':
gui()
如果您运行它(特别是在全屏模式下),就会看到窗口边缘附近有灰色边框。
它看起来像是PanedWindow小部件的边框(如果您将其设置为fill=NONE
并扩展窗口,则可以看到它)。请注意,ts边框宽度设置为0。
如何消除它或将其设置为某种颜色?