创建两个窗口而不是

2024-05-15 03:42:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经创建了这个tkinter小部件,但是当我运行代码时,我得到了一个MainWindow和一个标记为tk的窗口,而我只需要一个(MainWindow)

from tkinter import *
from tkinter.ttk import *
import backend


def Sll_command():
    row = backend.straightLineLink()
    print(row)



style = Style()
style.configure('W.TButton', front =('calibri', 10, 
'bold', 'underline'), foreground = 'red')

window = Tk()

window.wm_title("MainWindow")
window.resizable(width=True , height=True)

Grid.rowconfigure(window,0,weight=1)
Grid.columnconfigure(window, 0, weight=1)

b1 = Button(window, text = "SLL",
        style = 'W.TButton',
        command=Sll_command,)
b1.grid(row=2,column=5)

window.mainloop()

Tags: fromimportbackendtruestyletkinterwindowcommand

热门问题