CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Automatic Window size detection

Open Gabr1jel-01 opened this issue 2 years ago • 8 comments

Hello,

I apologise in advance if this issue has already been mentioned,but I am using customtkinter and I have created an application on my laptop (1920x1080, Scaling 100%). The application I am working on will be used on other displays and I dont't know their resoluton or scaling. I would like my app to change on the basis of the display resolution and scaling. Is that possible and if yes could you please help me?

Thanks in advance,

Cheers

Gabr1jel-01 avatar Sep 28 '23 17:09 Gabr1jel-01

Still need help with this?

luisyuburi avatar Oct 28 '23 22:10 luisyuburi

Yeah

Gabr1jel-01 avatar Oct 28 '23 22:10 Gabr1jel-01

    def on_window_resize(event): # print each time the windows is resize
        width = event.width
        height = event.height

      #  print(f"Window resized to {width}x{height}")
      #  SIZE_MAIN=[width,height]
      #  return SIZE_MAIN
    

    # Bind the resize event to a function
    self.bind("<Configure>", on_window_resize)

MaxNiark avatar Nov 06 '23 02:11 MaxNiark

in children

master.master.bind("<Configure>", self.on_window_resize)

MaxNiark avatar Nov 06 '23 02:11 MaxNiark

master.master.bind("<Configure>", self.on_window_resize)

MaxNiark avatar Nov 06 '23 02:11 MaxNiark

The problem is not the window of the application only. The biggest problem is how the widgets do not change size upon resizing of the window.

Gabr1jel-01 avatar Jan 04 '24 20:01 Gabr1jel-01

I dont really know whats the problem or whats not working exactly, by default the widgets should adapt to the display scaling, so they should be the same size on all displays.

TomSchimansky avatar Jan 10 '24 01:01 TomSchimansky

Yeaaah also which one placement method u'r using ? (pack/place/grid) each method have not the same effect :p

like, sticky in grid methid, is like expand in pack

MaxNiark avatar Jan 20 '24 13:01 MaxNiark