我正在尝试在主窗口的中心打开第二个窗口。它需要在主窗口所在的位置以及主窗口的大小范围内工作。我已经设置了一些测试小部件,以确保当第二个窗口关闭时,它会启用所有主窗口功能。
我正在使用什么。
我正在尝试做的事情的例子。
我的代码。
from guizero import *
app = App(bg='#121212',title='Main window',width=575,height=550)
app.tk.resizable(False, False)
def SecondWindow_closed():
secondWindow.destroy()
app.enable()
app.focus()
def System_secondWindow():
global secondWindow
secondWindow = Window(app,bg='#121212',title='Settings window',width=355,height=425)
secondWindow.tk.resizable(False, False)
About_project=Text(secondWindow,text='About this project ',align='bottom')
About_project.text_color='white'
secondWindow.tk.grab_set()
secondWindow.when_closed=SecondWindow_closed
Settings_button = PushButton(app, text='Settings ⚙',command=System_secondWindow)
Settings_button.text_color='white'
Test_widget=TextBox(app,)
Test_widget.bg='white'
app.display()