tkinter hide all the widget and show other when CTkSegmentedButton is clicked

45 views Asked by At

hello I am looking for a way to hide the buttons and show different one based on CTkSegmentedButton, which is placed on top of them as showing in image software image

the code for the application is written down below:

from customtkinter import *
from CTkMenuBar import *
from CTkXYFrame import *

set_appearance_mode("dark")

root = CTk()
root.title("Demo")
root.geometry("550x550")
root.minsize(550,550)

# Menu
menu = CTkMenuBar(master = root,bg_color = "#506c94")
menu.add_cascade("Edit")

# Tabs Buttons
def clicked_list(values):
    pass

mytabs = ["Search", "Downoads", "Settings"]
segemented_button = CTkSegmentedButton(master=root,
                                       values= mytabs,
                                       selected_color="#506c94",
                                       selected_hover_color="#728bad",
                                       height= 35,
                                       command=clicked_list)

segemented_button.pack(side="top", padx=5, pady=5, fill=X)
segemented_button.set("Search")

# Download Frame
download_frame = CTkFrame(master = root)
download_frame.pack(side="top", fill = X, padx = 5, pady = 5)

# Download Entry
link_entry = CTkEntry(master = download_frame, placeholder_text="CTkentry")
link_entry.pack(side="left", fill=X, expand=True)

# Download Button
link_button = CTkButton(master = download_frame)
link_button.pack(side="left", padx=3)

# Videos Frame
videos_frame = CTkFrame(master = root)
videos_frame.pack(side="top", expand="True", fill="both", padx=5, pady=5)

# Video 
videos_frame.grid_rowconfigure(0, weight=1)
videos_frame.grid_columnconfigure(0, weight=1)

scrollable = CTkScrollableFrame(master=videos_frame)
scrollable.grid(column=0,row=0, sticky="nesw")


root.mainloop()
0

There are 0 answers