-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubwindow.py
More file actions
38 lines (32 loc) · 918 Bytes
/
subwindow.py
File metadata and controls
38 lines (32 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import tkinter as tk
import threading
from tkinter import Label
from tkinter import font as tkfont
def show_commands():
"""Create a separate Tkinter window for commands."""
sub_window = tk.Tk()
sub_window.title("Commands")
sub_window.geometry("300x200")
custom_font = tkfont.Font(family="Helvetica", size=12, weight="bold")
commands = [
"Left Click: Set Start/End/Barrier",
"Right Click: Remove Barrier",
"Space: Start Pathfinding",
"Q: Generate Random Map",
"C: Clear Grid",
]
for command in commands:
Label(
sub_window,
text=command,
font=custom_font,
padx=10,
pady=5
).pack()
sub_window.mainloop()
# def main():
# threading.Thread(target=show_commands, daemon=True).start()
# while True:
# pass
# if __name__ == "__main__":
# main()