我有以下代码:
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
并展开窗口,您可以看到它)。注意tsborderwidth设置为0
我怎样才能摆脱它或将其设置为某种颜色?