versione prima di artos

This commit is contained in:
VALLONGOL 2025-12-19 09:52:06 +01:00
parent 01936497a0
commit 3f8849f0fb

View File

@ -318,21 +318,15 @@ class MonitorApp(tk.Frame):
# Use the form container for showing message details; do not toggle the
# tree visibility here. The DetailsPane places the form inside a
# scrollable canvas so it remains visible while updating.
# if same form is already shown, just refresh widget values
# if same form is already shown, refresh widget values safely
if getattr(self, 'current_form_label', None) == label and self.form_widgets:
try:
self._update_form_values(msg_wrapper)
# use the existing helper which fetches fresh wrapper and
# updates widgets without rebuilding the form
self._refresh_and_update_form()
except Exception:
pass
return
# clear previous form
for w in self.detail_form_container.winfo_children():
try:
w.destroy()
except Exception:
pass
self.form_widgets = {}
self.current_form_label = label
mdb = self._get_message_db()
if mdb is None:
@ -348,6 +342,15 @@ class MonitorApp(tk.Frame):
if msg is None:
return
# clear previous form only when we know we're going to build a new one
for w in self.detail_form_container.winfo_children():
try:
w.destroy()
except Exception:
pass
self.form_widgets = {}
self.current_form_label = label
# header with Apply button at top
hdr = tk.Frame(self.detail_form_container)
hdr.pack(fill=tk.X, padx=6, pady=(6,0))