Fix | console thread been block

This commit is contained in:
shenjack 2023-11-01 21:31:17 +08:00
parent 100c123bb9
commit acfbd344ec
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 31 additions and 2 deletions

5
DR.py
View File

@ -52,8 +52,9 @@ def start(start_time_ns: int) -> None:
print(crash.all_process)
for a_thread in threading.enumerate():
print(a_thread)
if a_thread.is_alive() and a_thread != threading.current_thread() and a_thread != threading.main_thread():
a_thread.join(2) # wait for 2 sec
if a_thread.is_alive() and not a_thread.daemon:
if a_thread != threading.current_thread() and a_thread != threading.main_thread():
a_thread.join(2) # wait for 2 sec
import pyglet
pyglet.app.exit() # make sure that pyglet has stopped

View File

@ -433,6 +433,34 @@ class TextEntry(WidgetBase):
assert type(value) is str, "This Widget's value must be a string."
self._doc.text = value
@property
def width(self):
return self._width
@width.setter
def width(self, value):
self._width = value
self._layout.width = value
self._outline.width = value
@property
def height(self):
return self._height
@height.setter
def height(self, value):
self._height = value
self._layout.height = value
self._outline.height = value
@property
def focus(self) -> bool:
return self._focus
@focus.setter
def focus(self, value: bool) -> None:
self._set_focus(value)
def _check_hit(self, x, y):
return self._x < x < self._x + self._width and self._y < y < self._y + self._height