I was trying to add a files view in my text editor. Is there any way to resize tkinter
frame by either x-axis or y-axis?
example:
like this resizing the files view.
Is there any way to do the same in a tkinter
frame?
I was trying to add a files view in my text editor. Is there any way to resize tkinter
frame by either x-axis or y-axis?
example:
like this resizing the files view.
Is there any way to do the same in a tkinter
frame?
If you mean, you want a splitter widget, you can make use of PanedWindow
.
Here is a minimal example:
import tkinter as tk
root = tk.Tk()
splitter = tk.PanedWindow(root, handlesize=2, orient=tk.HORIZONTAL)
splitter.pack(fill='both', expand=True)
leftFrame = tk.Frame(splitter, bg='red')
rightFrame = tk.Frame(splitter, bg='blue')
splitter.add(leftFrame, width=100)
splitter.add(rightFrame)
root.mainloop()
you can now expand the frame by using the handle.