Donny-GUI / tkinter-to-customtkinter-converter

Convert your tkinter scripts and guis to custom tkinter with this command line tool.
GNU General Public License v3.0
41 stars 3 forks source link

Error When Using CTkScrollbar: Unsupported Argument orient #3

Closed FrancoisDupontEpitech closed 5 months ago

FrancoisDupontEpitech commented 6 months ago

Description:

I encountered a ValueError when attempting to use the CTkScrollbar widget from the customtkinter library. The documentation suggests using the argument orient to specify the orientation of the scrollbar. However, this results in a ValueError indicating that orient is not a supported argument.

Steps to Reproduce:

  1. Initialize a CTkScrollbar widget with the orient argument: scrollbar = ctk.CTkScrollbar(self.root, orient="vertical", command=canvas.yview)

  2. Run the application.

Expected Behavior:

The scrollbar should be created without any errors, with the specified orientation.

Actual Behavior:

The application raises a ValueError: ValueError: ['orient'] are not supported arguments.

Solution:

Upon reviewing the customtkinter documentation and source code, I found that the correct argument for specifying the orientation of a CTkScrollbar is orientation, not orient. Updating my code accordingly resolved the issue: scrollbar = ctk.CTkScrollbar(self.root, orientation="vertical", command=canvas.yview) This modification allowed the scrollbar to function as expected without raising an error.

FrancoisDupontEpitech commented 6 months ago

Same error in the CTkComboBox for textvariable which should be change to variable.

This line raise an error: ctk.CTkComboBox(self.root, textvariable=self.mode_var, values=["whitepaper", "ads"]).pack()

Error: ValueError: ['textvariable'] are not supported arguments. Look at the documentation for supported arguments.

Solution: ctk.CTkComboBox(self.root, variable=self.mode_var, values=["whitepaper", "ads"]).pack()

Donny-GUI commented 5 months ago

Thank you. Ill start working on this right now.

Donny-GUI commented 5 months ago

Please take a look at the new source. or test it to make sure that the parameter for func/class instances are changed to their respective counterparts.

FrancoisDupontEpitech commented 5 months ago

Thanks you !