From acfbd344ec7e8274ee1f6b865e57e63cd80b1eee Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 1 Nov 2023 21:31:17 +0800 Subject: [PATCH] Fix | console thread been block --- DR.py | 5 +++-- libs/pyglet/gui/widgets.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/DR.py b/DR.py index 3aacbc7..09a5ec4 100644 --- a/DR.py +++ b/DR.py @@ -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 diff --git a/libs/pyglet/gui/widgets.py b/libs/pyglet/gui/widgets.py index 922746b..010953c 100644 --- a/libs/pyglet/gui/widgets.py +++ b/libs/pyglet/gui/widgets.py @@ -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