CustomTkinter
CustomTkinter copied to clipboard
Redefine the window size after changing the scale
Hello everyone,
I hope this is the appropriate place to seek assistance.
I've created a graphical user interface using the fantastic library, and I've run into an issue. When switching between windows in the navigation frame, the window size adjusts correctly based on the included widgets. However, after selecting a specific scale, the window size remains constant for all windows. I've attached a video illustrating this problem:
https://github.com/TomSchimansky/CustomTkinter/assets/69217590/eb604a5d-63cb-4394-9407-d457424a78e4
I'm eager to learn how to dynamically adjust the window size according to the widgets, even after changing the scale.
Additionally, I've observed that the transition between windows can be a bit abrupt, sometimes causing screen flickering with black backgrounds. Is there a way to minimize this?
Thank you in advance for any assistance provided.
@DimaTepliakov Probably a bug. You can also use the geometry method to resize the window. self.geometry(f"{frame_width}x{frame_height}")
. But for this you have to calculate the right + left frame's width and right frame's height.
Hi @DimaTepliakov, I'm trying to create similar view when button clicked need to change the frame. Can you help me how did you created this view with sample code would help me. I appreciate your efforts in making this view.
Thanks in Advance.
Hi @DimaTepliakov, I'm trying to create similar view when button clicked need to change the frame. Can you help me how did you created this view with sample code would help me. I appreciate your efforts in making this view.
Thanks in Advance.
I use the customtkinter image example in order to create something as a basis to this view.
Hi @DimaTepliakov, I'm trying to create similar view when button clicked need to change the frame. Can you help me how did you created this view with sample code would help me. I appreciate your efforts in making this view. Thanks in Advance.
I use the customtkinter image example in order to create something as a basis to this view.
Thank you @DimaTepliakov Just now I have tried this, but in my frame, I have multiple value entries, combo box etc. which is getting reset whenever I switch back to same frame. I need frame should restore to user given values. even after switching to other frames.
Hi @DimaTepliakov, I'm trying to create similar view when button clicked need to change the frame. Can you help me how did you created this view with sample code would help me. I appreciate your efforts in making this view. Thanks in Advance.
I use the customtkinter image example in order to create something as a basis to this view.
Thank you @DimaTepliakov Just now I have tried this, but in my frame, I have multiple value entries, combo box etc. which is getting reset whenever I switch back to same frame. I need frame should restore to user given values. even after switching to other frames.
Are you using the methods: frame.grid(row=0, column=1, sticky="nsew") and frame.grid_forget()?
Hi @DimaTepliakov, I'm trying to create similar view when button clicked need to change the frame. Can you help me how did you created this view with sample code would help me. I appreciate your efforts in making this view. Thanks in Advance.
I use the customtkinter image example in order to create something as a basis to this view.
Thank you @DimaTepliakov Just now I have tried this, but in my frame, I have multiple value entries, combo box etc. which is getting reset whenever I switch back to same frame. I need frame should restore to user given values. even after switching to other frames.
Are you using the methods: frame.grid(row=0, column=1, sticky="nsew") and frame.grid_forget()?
Its working now, Thanks
@DimaTepliakov Probably a bug. You can also use the geometry method to resize the window.
self.geometry(f"{frame_width}x{frame_height}")
. But for this you have to calculate the right + left frame's width and right frame's height.
Is there a simple way to measure all the widget's height and width in selected window?
@DimaTepliakov widget.winfo_reqheight()
and widget.winfo_reqwidth()
are more efficient in measuring the frames.