Skip to content
Advertisement

How to set a maximum limit for dragging in tkinter PanedWindow?

JavaScript

In the above code, I don’t want the frame1 to expand too much when dragged. How can I set a limit for this?

Advertisement

Answer

There are no straightforward ways to do this. You can achieve this either by setting minsize for frame2.

Something like this:

JavaScript

Another way is to return "break" when the sash position is greater than the max-width so it no longer can be moved.

minimal example:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement