Added scrollbar

This commit is contained in:
Tristan Smith 2024-06-01 02:21:14 -04:00
parent 2df9dc0c62
commit 9bbdd0b985

8
gui.py
View file

@ -77,13 +77,19 @@ root.title("IP Reporter")
# Create a frame for the tree view # Create a frame for the tree view
frame = tk.Frame(root) frame = tk.Frame(root)
frame.pack(padx=10, pady=10) frame.pack(padx=10, pady=10, fill=tk.BOTH, expand=True)
# Create a tree view with columns for IP and MAC # Create a tree view with columns for IP and MAC
columns = ("IP Address", "MAC Address") columns = ("IP Address", "MAC Address")
tree = ttk.Treeview(frame, columns=columns, show="headings") tree = ttk.Treeview(frame, columns=columns, show="headings")
tree.heading("IP Address", text="IP Address") tree.heading("IP Address", text="IP Address")
tree.heading("MAC Address", text="MAC Address") tree.heading("MAC Address", text="MAC Address")
# Add a vertical scrollbar to the tree view
scrollbar = ttk.Scrollbar(frame, orient="vertical", command=tree.yview)
tree.configure(yscrollcommand=scrollbar.set)
scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
tree.pack(fill=tk.BOTH, expand=True) tree.pack(fill=tk.BOTH, expand=True)
# Bind double click to open in browser # Bind double click to open in browser