Skip to content

Conversation

@Shubham25dec
Copy link

the customtkinter.CTkRadioButton class' configure method throws an error when called with 'value' keyword argument eg:
radio_button = CTkRadioButton(master)
radio_button.configure(value = 2)

This is solved by adding an if statement to check for the 'value' kwarg and thus update the _value variable in the class.

@FedericoSpada
Copy link
Collaborator

Hi,
No other widget has a similar thing. Usually, they implement a set() method to do that.

I plan to change "value" parameters in all init() methods into "default_value" or "init_value" so that it is clearer that that value is used just once at the initialization phase and never after.
At the same time, I will add a set() method for all widgets (CTkEntry needs it badly, too).
Do you think this is a good solution?

FedericoSpada added a commit that referenced this pull request Jan 13, 2026
- Added missing attributes to the configure() method for all widgets.
- Allowed changing a CTkButton image using configure even if the widget was created without any image.
- Prevented warning when an image is set to "" with configure() to delete it.
- Fixed CTkCheckbox hover_color for the blue theme, which was hiding the hover effect when checked.
Fixes #1215, #1750, #2494 and replaces #2412, #2719

Co-Authored-By: Shubham25dec <[email protected]>
Co-Authored-By: fred Jose Diaz <[email protected]>
@FedericoSpada
Copy link
Collaborator

Sorry, I've misinterpreted the meaning of the "value" attribute.
While performing an overall configure() clean-up, I've also added the changes you proposed.
I've added you as a co-author of the commit. I close this PR since it is now redundant.

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

Successfully merging this pull request may close these issues.

2 participants