3
我有以下代碼:如何擺脫小部件邊框?
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
如何擺脫它或將其設置爲某種顏色?