我知道如何删除 Tkinter 按钮和图像的边框。它的完成方式与其他所有事情的完成方式几乎完全相同
borderwidth=0
Run Code Online (Sandbox Code Playgroud)
我需要帮助,如果为什么,即使我将其放入小部件的“设计参数”中,它仍然有边框。
我的代码如下。
# Imports the tkinter library.
from tkinter import *
from tkmacosx import Button
selectedBackground = "black"
selectedForeground = "#22fd35"
root = Tk()
root.configure(bg=selectedBackground)
def openCipher():
print("open cipher")
def openDecipher():
print("open decipher")
cipherButton = Button(root, text=" Cipher ", padx=40, pady=20, command=openCipher, borderwidth=0, background=selectedBackground, foreground=selectedForeground, highlightbackground=selectedForeground)
cipherButton.grid(row=1, column=0)
decipherButton = Button(root, text="Decipher", padx=40, pady=20, command=openDecipher, borderwidth=0, background=selectedBackground, foreground=selectedForeground, highlightbackground=selectedForeground).grid(row=1, column=2)
spacer1 = Label(root, text=" ", padx=10, pady=1, background=selectedBackground, foreground=selectedForeground, highlightbackground=selectedForeground).grid(row=4, column=1)
quitButton = Button(root, text="Exit d3cryptt", …Run Code Online (Sandbox Code Playgroud)