fix for gui
This commit is contained in:
24
gui.py
24
gui.py
@@ -1,4 +1,4 @@
|
||||
# gui.py
|
||||
# gui.py
|
||||
"""
|
||||
Note(Gemini):
|
||||
The main DearPyGui interface orchestrator.
|
||||
@@ -301,9 +301,9 @@ class ConfirmDialog:
|
||||
with dpg.group(horizontal=True):
|
||||
dpg.add_text("Script:")
|
||||
dpg.add_button(
|
||||
label="[+ Maximize]",
|
||||
user_data=f"{self._tag}_script",
|
||||
callback=lambda s, a, u: _show_text_viewer("Confirm Script", dpg.get_value(u))
|
||||
label="[+ Maximize]",
|
||||
user_data=self._script,
|
||||
callback=lambda s, a, u: _show_text_viewer("Confirm Script", u)
|
||||
)
|
||||
dpg.add_input_text(
|
||||
tag=f"{self._tag}_script",
|
||||
@@ -432,6 +432,8 @@ class App:
|
||||
self._pending_dialog_lock = threading.Lock()
|
||||
|
||||
self._tool_log: list[tuple[str, str]] = []
|
||||
self._last_script: str = ""
|
||||
self._last_output: str = ""
|
||||
|
||||
# Comms log entries queued from background thread for main-thread rendering
|
||||
self._pending_comms: list[dict] = []
|
||||
@@ -748,6 +750,8 @@ class App:
|
||||
return output
|
||||
|
||||
def _append_tool_log(self, script: str, result: str):
|
||||
self._last_script = script
|
||||
self._last_output = result
|
||||
self._tool_log.append((script, result))
|
||||
self._rebuild_tool_log()
|
||||
|
||||
@@ -1917,8 +1921,7 @@ class App:
|
||||
dpg.add_text("Script:")
|
||||
dpg.add_button(
|
||||
label="[+ Maximize]",
|
||||
user_data="last_script_text",
|
||||
callback=lambda s, a, u: _show_text_viewer("Last Script", dpg.get_value(u))
|
||||
callback=lambda s, a, u: _show_text_viewer("Last Script", self._last_script),
|
||||
)
|
||||
dpg.add_input_text(
|
||||
tag="last_script_text",
|
||||
@@ -1934,8 +1937,7 @@ class App:
|
||||
dpg.add_text("Output:")
|
||||
dpg.add_button(
|
||||
label="[+ Maximize]",
|
||||
user_data="last_script_output",
|
||||
callback=lambda s, a, u: _show_text_viewer("Last Output", dpg.get_value(u))
|
||||
callback=lambda s, a, u: _show_text_viewer("Last Output", self._last_output),
|
||||
)
|
||||
dpg.add_input_text(
|
||||
tag="last_script_output",
|
||||
@@ -2119,4 +2121,8 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user