Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/6836.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed blue checkboxes issue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(self, withdraw: bool = False):
port=get_port(), version=get_aedt_version(), aedt_process_id=get_process_id(), student_version=is_student()
)
self.export_options = ExportOptions()
self.export_option_vars = {}

super().__init__(
self.EXTENSION_TITLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,18 @@ def create_sub_frame1(parent, master):

row = row + 1
options = master.export_options.model_dump()

# Initialize checkbox variables if not already created
if not master.export_option_vars:
for name in options:
master.export_option_vars[name] = tk.BooleanVar(master=master.root, value=options[name])

for idx, name in enumerate(options):
col = idx % 2
chk = ttk.Checkbutton(parent, name=name, text=name, style="PyAEDT.TCheckbutton")
chk.grid(row=row, column=col, **{"sticky": "nsew"})
if options[name]:
chk.state(["selected"])
else:
chk.state(["!selected"])
chk = ttk.Checkbutton(
parent, name=name, text=name, variable=master.export_option_vars[name], style="PyAEDT.TCheckbutton"
)
chk.grid(row=row, column=col, padx=5, pady=2, sticky="w")
row = row if col == 0 else row + 1


Expand Down Expand Up @@ -174,8 +178,5 @@ def callback_export(master):

def update_options(master):
"""Update export options based on the selected checkboxes."""
options = master.export_options.model_dump()
for name in options:
chk = master.root.nametowidget(f".notebook.main.frame1.{name}")
flag = True if chk.instate(["selected"]) else False
setattr(master.export_options, name, flag)
for name, var in master.export_option_vars.items():
setattr(master.export_options, name, var.get())
Loading