Skip to content

Commit bf3593a

Browse files
committed
gui: link to pyvista documentation for using the plotting window
1 parent b152e1a commit bf3593a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/qcodeplot3d/gui.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import signal
3+
import webbrowser
34
from concurrent.futures import Executor, Future, ProcessPoolExecutor
45
from enum import Enum
56
from tkinter import BooleanVar, IntVar, StringVar, Tk, ttk
@@ -76,6 +77,15 @@ def change_state(*elem: list[ttk.Widget], state: str) -> None:
7677
e.configure(state=state)
7778

7879

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+
7989
class CodeConfig:
8090
root: Tk
8191
pool: Executor
@@ -572,6 +582,13 @@ def __init__(self) -> None:
572582
plotter_dm_plot_frame = self.plotter_config.create_dual_plot_frame(content)
573583
plotter_dm_plot_frame.grid(row=10, column=10, sticky="nsew")
574584

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+
575592
self.root.columnconfigure(0, weight=1)
576593
self.root.rowconfigure(0, weight=1)
577594
content.columnconfigure(0, weight=1)

0 commit comments

Comments
 (0)