Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to create filled radio button? #2456

Open
teijiIshida opened this issue Jun 4, 2024 · 4 comments
Open

Is it possible to create filled radio button? #2456

teijiIshida opened this issue Jun 4, 2024 · 4 comments

Comments

@teijiIshida
Copy link

teijiIshida commented Jun 4, 2024

I'm trying to create radio buttons that have filled center. The current CTkRadioButton have transparent center. I tried changing the fg_color (but it changed the border color???), border_color (doesn't help), border_width_checked (almost replicated but still has a tiny bit transparent in the center but now it no longer have a proper border). Top image is what I'm trying to create (not my GUI). Bottom image is my current radio buttons. Is it possible to create filled radio button?

2024-06-04 12_11_08-ConfigTools v0 3 03 20a
2024-06-04 12_11_16-JVP Batch Files Config Tool v0 1

        self.radio_var1 = ctk.StringVar(value="png")
        self.radiobutton_1 = ctk.CTkRadioButton(self.main_settings_Cframe, text="PNG", font=self.main_font, command=self.radiobutton_event, variable=self.radio_var1, value="png")
        self.radiobutton_1.grid(row=3, column=0, padx=0, pady=1, sticky="nw")                                             
        self.radiobutton_2 = ctk.CTkRadioButton(self.main_settings_Cframe, text="JPG", font=self.main_font, command=self.radiobutton_event, variable=self.radio_var1, value="jpg")
        self.radiobutton_2.grid(row=3, column=0, padx=70, pady=1, sticky="nw")
@dipeshSam
Copy link

dipeshSam commented Jun 5, 2024

It is the standard appearance of a Radio Button 🔘 (Historically) that there should be a container (either circular or rectangular) around the point regardless of selection.

Still if your GUI requires point type button acting like a radio button, you can utilise Canvas's circle. Assign a tag to it, bind an event, and that's it.

customtkinter provides a method create_aa_circle() to draw quality Anti-Aliased shape of circle.

Regards.

@teijiIshida
Copy link
Author

teijiIshida commented Jun 5, 2024

Ok, I understand the Canvas solution.

Edit: Thank you. I found an example using it on Google/Youtube.

@teijiIshida
Copy link
Author

I'm trying to find the documentation for CTkCanvas here, but I don't see it. Where can I read its documentation?

@dipeshSam
Copy link

The Excessive Tkinter documention can be fount at: https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants