Dec-28-2024, 07:17 AM
Here is the MRP code of the situation:
For that matter, is there a(nother) way to restrict sash movement? (The code above would be modified to make the GUI user not shrink the left pane too much with a minimum width if it worked)
If that's helpful, I am in Fedora Worksation 41.
def enforce_sash_limits(self, event): self.main_paned_win.sashpos(0, 120) def init_pagebrowser(self): self.main_paned_win = ttk.PanedWindow(self.pages_area_frame, orient=tk.HORIZONTAL) self.slides_pane = tk.Frame(self.main_paned_win, bg=colorconsts.BG_COLOR) self.slides_pane.pack(side=tk.LEFT, fill=tk.BOTH, expand=True) self.main_paned_win.add(self.slides_pane, weight=3) self.preview_pane = tk.Frame(self.main_paned_win, bg="magenta") self.preview_pane.pack(side=tk.LEFT, fill=tk.BOTH, expand=True) self.main_paned_win.add(self.preview_pane, weight=2) self.main_paned_win.pack(fill=tk.BOTH, expand=True) self.slides_area_class = SlidesArea(self.slides_pane) self.slides_area_class.pack(fill=tk.BOTH, expand=True) self.main_paned_win.bind("\<B1-Motion\>", self.enforce_sash_limits) #<-----I expected that everytime I drag the sash, the sash would fix itself to a specific position. But it doesnt and just lets itself be dragged into whatever it likes. How to solve this? I dont want to switch to tk.PanedWindow because I had layering issues with that one.
For that matter, is there a(nother) way to restrict sash movement? (The code above would be modified to make the GUI user not shrink the left pane too much with a minimum width if it worked)
If that's helpful, I am in Fedora Worksation 41.