fix: 修复消息处理导致的闪退问题
This commit is contained in:
@@ -35,9 +35,9 @@ class PreparationScreen(Screen):
|
||||
yield Header(show_clock=True)
|
||||
with Container(id="vice_container"):
|
||||
yield Label(f"准备就绪: [b]{self.nucleon_file.stem}[/b]\n")
|
||||
yield Label(f"内容源文件对象: ./nucleon/[b]{self.nucleon_file.name}[/b].toml")
|
||||
yield Label(f"元数据文件对象: ./electron/[b]{self.electron_file.name}[/b].toml")
|
||||
yield Label(f"\n单元数量:{len(self.nucleons_with_orbital)}\n")
|
||||
yield Label(f"内容源文件对象: ./nucleon/[b]{self.nucleon_file.name}[/b]")
|
||||
yield Label(f"元数据文件对象: ./electron/[b]{self.electron_file.name}[/b]")
|
||||
yield Label(f"\n单元数量: {len(self.nucleons_with_orbital)}\n")
|
||||
|
||||
yield Button(
|
||||
"开始记忆",
|
||||
@@ -75,7 +75,8 @@ class PreparationScreen(Screen):
|
||||
def action_quit_app(self):
|
||||
self.app.exit()
|
||||
|
||||
def on_button_pressed(self, event) -> None:
|
||||
def on_button_pressed(self, event: Button.Pressed) -> None:
|
||||
event.stop()
|
||||
if event.button.id == "start_memorizing_button":
|
||||
atoms = list()
|
||||
for nucleon, orbital in self.nucleons_with_orbital:
|
||||
@@ -97,4 +98,5 @@ class PreparationScreen(Screen):
|
||||
memscreen = MemScreen(atoms)
|
||||
self.app.push_screen(memscreen)
|
||||
elif event.button.id == "precache_button":
|
||||
self.action_precache()
|
||||
self.action_precache()
|
||||
|
||||
Reference in New Issue
Block a user