|
1 | 1 | import os |
2 | 2 | import signal |
| 3 | +import webbrowser |
3 | 4 | from concurrent.futures import Executor, Future, ProcessPoolExecutor |
4 | 5 | from enum import Enum |
5 | 6 | from tkinter import BooleanVar, IntVar, StringVar, Tk, ttk |
@@ -76,6 +77,15 @@ def change_state(*elem: list[ttk.Widget], state: str) -> None: |
76 | 77 | e.configure(state=state) |
77 | 78 |
|
78 | 79 |
|
| 80 | +def create_hyperlink(root: Tk, text: str, url: str) -> ttk.Label: |
| 81 | + def callback(event): |
| 82 | + webbrowser.open_new(url) |
| 83 | + |
| 84 | + link = ttk.Label(root, text=text, foreground="blue", cursor="hand2") |
| 85 | + link.bind("<Button-1>", callback) |
| 86 | + return link |
| 87 | + |
| 88 | + |
79 | 89 | class CodeConfig: |
80 | 90 | root: Tk |
81 | 91 | pool: Executor |
@@ -572,6 +582,13 @@ def __init__(self) -> None: |
572 | 582 | plotter_dm_plot_frame = self.plotter_config.create_dual_plot_frame(content) |
573 | 583 | plotter_dm_plot_frame.grid(row=10, column=10, sticky="nsew") |
574 | 584 |
|
| 585 | + link = create_hyperlink( |
| 586 | + content, |
| 587 | + text="Consult the PyVista Documentation at how to manipulating the plotting windows.", |
| 588 | + url=r"https://docs.pyvista.org/api/plotting/plotting.html#plotting", |
| 589 | + ) |
| 590 | + link.grid(row=11, column=0, columnspan=20, sticky="nsew") |
| 591 | + |
575 | 592 | self.root.columnconfigure(0, weight=1) |
576 | 593 | self.root.rowconfigure(0, weight=1) |
577 | 594 | content.columnconfigure(0, weight=1) |
|
0 commit comments