(tab_name)
| 322 | |
| 323 | # Function to populate a tab in the background |
| 324 | def populate_tab(tab_name): |
| 325 | group = tab_groups[tab_name] |
| 326 | scrollable_frame = tab_scrollable_frames[tab_name] |
| 327 | canvas = tab_canvases[tab_name] |
| 328 | |
| 329 | # Remove loading indicator |
| 330 | for child in scrollable_frame.winfo_children(): |
| 331 | child.destroy() |
| 332 | |
| 333 | # Add content to the scrollable frame |
| 334 | row = 0 |
| 335 | |
| 336 | if group.get_description(): |
| 337 | desc_label = _tkinter.Label(scrollable_frame, text=group.get_description(), |
| 338 | wraplength=600, justify="left", |
| 339 | font=('Helvetica', 9), |
| 340 | fg="#555555", bg=bg_color) |
| 341 | desc_label.grid(row=row, column=0, columnspan=3, sticky="w", padx=10, pady=(10, 5)) |
| 342 | row += 1 |
| 343 | |
| 344 | for option in group.option_list: |
| 345 | # Option label |
| 346 | option_label = _tkinter.Label(scrollable_frame, |
| 347 | text=parser.formatter._format_option_strings(option) + ":", |
| 348 | font=('Helvetica', 9), |
| 349 | fg=fg_color, bg=bg_color, |
| 350 | anchor="w") |
| 351 | option_label.grid(row=row, column=0, sticky="w", padx=10, pady=2) |
| 352 | |
| 353 | # Input widget |
| 354 | if option.type == "string": |
| 355 | widget = _tkinter.Entry(scrollable_frame, font=('Helvetica', 9), |
| 356 | relief="sunken", bd=1, width=20) |
| 357 | widget.grid(row=row, column=1, sticky="w", padx=5, pady=2) |
| 358 | elif option.type == "float": |
| 359 | widget = ConstrainedEntry(scrollable_frame, regex=r"\A\d*\.?\d*\Z", |
| 360 | font=('Helvetica', 9), |
| 361 | relief="sunken", bd=1, width=10) |
| 362 | widget.grid(row=row, column=1, sticky="w", padx=5, pady=2) |
| 363 | elif option.type == "int": |
| 364 | widget = ConstrainedEntry(scrollable_frame, regex=r"\A\d*\Z", |
| 365 | font=('Helvetica', 9), |
| 366 | relief="sunken", bd=1, width=10) |
| 367 | widget.grid(row=row, column=1, sticky="w", padx=5, pady=2) |
| 368 | else: |
| 369 | var = _tkinter.IntVar() |
| 370 | widget = _tkinter.Checkbutton(scrollable_frame, variable=var, |
| 371 | bg=bg_color, activebackground=bg_color) |
| 372 | widget.var = var |
| 373 | widget.grid(row=row, column=1, sticky="w", padx=5, pady=2) |
| 374 | |
| 375 | # Help text (truncated to improve performance) |
| 376 | help_text = option.help |
| 377 | if len(help_text) > 100: |
| 378 | help_text = help_text[:100] + "..." |
| 379 | |
| 380 | help_label = _tkinter.Label(scrollable_frame, text=help_text, |
| 381 | font=('Helvetica', 8), |
no test coverage detected
searching dependent graphs…