TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
10.8k stars 1.03k forks source link

Adjustable Frames #2390

Open sidhantsambyal opened 2 months ago

sidhantsambyal commented 2 months ago

Discussed in https://github.com/TomSchimansky/CustomTkinter/discussions/2389

Originally posted by **sidhantsambyal** April 24, 2024 I have 2 frame : left and right but left has tree and the content sometime is big that it hides behind the right frame, Is there a way to make frame adjustible according to users need?
joocam commented 2 months ago

Can you send me the code? It would be easier to understand your needs.

ashishchib2 commented 2 months ago

Creating Left Frame

left_frame = CheckboxTreeview(app)
y_scrollbar = tk.Scrollbar(left_frame, orient="vertical", command=left_frame.yview)
y_scrollbar.pack(side=ctk.RIGHT, fill=ctk.Y)
# x_scrollbar = tk.Scrollbar(left_frame, orient="horizontal", command=left_frame.xview)
# x_scrollbar.pack(side=ctk.BOTTOM, fill=ctk.X)
base_xml_file_path = utils.get_base_xml_path()
tree = utils.parse_xml_file(base_xml_file_path)
root_element = tree.getroot()
build_tree(left_frame, "", root_element)
left_frame.pack(side=ctk.LEFT, fill=ctk.BOTH, expand=True)

# -------------------------------------------------
# Creating Right Frame
right_frame = ctk.CTkFrame(app, border_width=0, bg_color="#F2F2F2")

# -------------------------------------------------
# Right Top Frame
right_top_frame = ctk.CTkFrame(right_frame, bg_color="#F2F2F2", border_width=0)

When the content in Xml is too big, the content is hidden behind the right frame. So can user drag the frame to adjust the frames according to the need