Replies: 2 comments
-
You can actually add radiobuttons and checkboxes to the CTkMenuBar. Here's a simple code example: from CTkMenuBar import CTkMenuBar, CustomDropdownMenu
import customtkinter as ctk
root = ctk.CTk()
root.geometry("400x400")
menubar = CTkMenuBar(root)
radiobuttons_menu = menubar.add_cascade("Radiobuttons menu")
radiobuttons_dropdown = CustomDropdownMenu(widget=radiobuttons_menu)
radiobuttons_dropdown.add_option(option="Option 1")
radiobuttons_dropdown.add_option(option="Option 2")
radiobutton_1 = ctk.CTkRadioButton(radiobuttons_dropdown, text="RadioButton 1")
radiobutton_1.pack(padx=10, pady=10)
radiobutton_2 = ctk.CTkRadioButton(radiobuttons_dropdown, text="RadioButton 2")
radiobutton_2.pack(padx=10, pady=10)
radiobutton_3 = ctk.CTkRadioButton(radiobuttons_dropdown, text="RadioButton 3")
radiobutton_3.pack(padx=10, pady=10)
checkbox_1 = ctk.CTkCheckBox(radiobuttons_dropdown, text="Checkbox 1")
checkbox_1.pack(padx=10, pady=10)
checkbox_2 = ctk.CTkCheckBox(radiobuttons_dropdown, text="Checkbox 2")
checkbox_2.pack(padx=10, pady=10)
checkbox_3 = ctk.CTkCheckBox(radiobuttons_dropdown, text="Checkbox 3")
checkbox_3.pack(padx=10, pady=10)
root.mainloop() This is what came out of it: |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks
pt., 4 kwi 2025, 19:11 użytkownik Maksim ***@***.***> napisał:
… You can actually add radiobuttons and checkboxes to the CTkMenuBar. Here's
a simple code example:
from CTkMenuBar import CTkMenuBar, CustomDropdownMenuimport customtkinter as ctk
root = ctk.CTk()root.geometry("400x400")
menubar = CTkMenuBar(root)
checkbox_menu = menubar.add_cascade("Checkboxes menu")checkbox_dropdown = CustomDropdownMenu(widget=checkbox_menu)
checkbox_dropdown.add_option(option="Option 1")checkbox_dropdown.add_option(option="Option 2")checkbox_dropdown.add_option(option="Option 3")checkbox_dropdown.add_option(option="Option 4")checkbox_dropdown.add_option(option="Option 5")
checkbox_1 = ctk.CTkCheckBox(checkbox_dropdown, text="Checkbox 1")checkbox_1.pack(padx=10, pady=10)
checkbox_2 = ctk.CTkCheckBox(checkbox_dropdown, text="Checkbox 2")checkbox_2.pack(padx=10, pady=10)
checkbox_3 = ctk.CTkCheckBox(checkbox_dropdown, text="Checkbox 3")checkbox_3.pack(padx=10, pady=10)
radiobutton = ctk.CTkRadioButton(checkbox_dropdown, text="RadioButton")radiobutton.pack(padx=10, pady=10)
root.mainloop()
This is what came out of it:
_2025-03-18_18-28-33.png (view on web)
<https://github.com/user-attachments/assets/56407b5d-fe90-42e4-a11a-6a5b7f6927b2>
—
Reply to this email directly, view it on GitHub
<#2702 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BQY4LK2T2PIZZNFZHQWV5VT2X24MLAVCNFSM6AAAAABZUYB35CVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENZSHA3TSNA>
.
You are receiving this because you authored the thread.Message ID:
<TomSchimansky/CustomTkinter/repo-discussions/2702/comments/12728794@
github.com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How to add radiobuttons to CTkMenuBar 0.8 ?
Beta Was this translation helpful? Give feedback.
All reactions