CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Window scalling

Open a95444 opened this issue 3 years ago • 7 comments

When I use my application in a monitor bigger than the one my laptop has, the widgets size just goes nuts. Is there any way I can "fixate" the size of the entire window/widgets? Thanks for your time.

biggermonitor mylaptop

a95444 avatar Sep 27 '22 09:09 a95444

the listbox is a "normal tkinter" widget, I dont think customtkinter library has a listbox option yet.

a95444 avatar Sep 27 '22 09:09 a95444

Can you give me some information about your monitor setup? What resolution has the external monitor? And what are the scaling settings (100%, 150%, 200%) for the internal and external monitor in the Windows display settings? The first image is on the external monitor?

TomSchimansky avatar Sep 27 '22 10:09 TomSchimansky

Yes of course! 1st image - external monitor / 100% ; 1920 x 1080 2nd image - laptop monitor / 200%; 3000 x 2000

Thanks for the help! If you require some more info, I'll be glad to give it.

a95444 avatar Sep 27 '22 10:09 a95444

There are a few different things going on which make it look ugly:

  1. The window header size remains like it was, when it got created. So when the window gets created on a 200% scaled monitor, the window header looks twice as big on a 100% monitor like the normal window headers. But there is nothing I can do about this I think, I don't know why this happens with tkinter windows.

  2. Normal tkinter widgets don't adapt to the scaling set in Windows for the monitors. So when you design the app on the internal monitor you make the listbox as big as it needs to be to look normal with the font size. But when you move the window to the 100% monitor it looks way too big. Also something you can't do anything about it. You can just wait till I create a CTkListbox which will I will resize automatically according to the currently detected monitor scaling. I will also finish the CTkTextbox in the next time, maybe this will also work.

  3. The images of the buttons also don't adapt to the scaling. That's something I will fix. When you move the window on the 100% monitor all the images would need to be resized to half the size...

  4. The font size of the buttons (like FTC) is not scaled correctly. I don't know why this happened. How do you set the font size of the buttons? With a positive number in pt like ("Name", 12) or with a negative number in pixels like ("Name", -10)?

TomSchimansky avatar Sep 27 '22 11:09 TomSchimansky

I didn't give a font size to the buttons text. I have configure them like this: image

a95444 avatar Sep 27 '22 11:09 a95444

And how do you defined the buttons with AT SS FTC and DS contributive? Or are these labels?

TomSchimansky avatar Sep 27 '22 18:09 TomSchimansky

They are buttons aswell. image

a95444 avatar Sep 27 '22 18:09 a95444

Most of the issues here should be fixed now, also by using CTkImage for the images.

TomSchimansky avatar Dec 06 '22 22:12 TomSchimansky

Did you find a solution with a window header scalling? Got the same issue

Karol1302 avatar Nov 21 '23 10:11 Karol1302