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

CTkCanvas Uses Different Scaling Than Other Widgets #2461

Open
RetroDeveloper232 opened this issue Jun 8, 2024 · 2 comments
Open

CTkCanvas Uses Different Scaling Than Other Widgets #2461

RetroDeveloper232 opened this issue Jun 8, 2024 · 2 comments

Comments

@RetroDeveloper232
Copy link

I am developing a calculator application that uses the grid() geometry manager. I noticed the CTkCanvas widget does not scale like other widgets when declaring the canvas's width/height. Moreover, I attached some pictures of the issue and how the canvas is similar in width to the operation bar when it should not be. Moreover, a list of arguments is nonexistent for CTkCanvas when the other widgets have their arguments transparent (For Pylance's option of listing all present arguments in a class/function).
calculator
ctk-canvas
ctk-frame

@dipeshSam
Copy link

dipeshSam commented Jun 9, 2024

It's true that Canvas does not scale and even does not have appearance mode in customtkinter.

Why are there two __init__ methods in your Display class?

Could you please provide sample reproducible code demonstrating how Canvas and Frame width mismatch in your case.

Regards.

@RetroDeveloper232
Copy link
Author

RetroDeveloper232 commented Jun 9, 2024

Hi @dipeshSam ,
As you know, the init method is responsible for initializing the arguments in a class. When you inherit another class, these arguments can only be customized using the super().__init__() method. To clarify, the first init creates arguments for the new class, while the second init inherits the arguments from the original CustomTkinter class, allowing for configurations of the original base class. I hope this explanation is clear.

Moreover, I will provide a more apparent example of the inconsistent sizing associated with the CustomTkinter Canvas class. The two widgets are both ten pixels less in width than their masters, yet the display still touches the sides of the screen. This seems to be an occurrence only at higher sizes (ex: 30 pixels less make them equal in sizing).

Screenshot 2024-06-09 at 1 07 15 PM Screenshot 2024-06-09 at 1 07 23 PM Screenshot 2024-06-09 at 1 08 06 PM

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