From 31bd138570f2b0628a7da0dc4740affb7019d1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 23 Sep 2019 20:24:18 +0200 Subject: [PATCH] Fix canvas windows size regarding scrollbars. --- libgui/GuiWindow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libgui/GuiWindow.py b/libgui/GuiWindow.py index 6829307..3bc9be3 100644 --- a/libgui/GuiWindow.py +++ b/libgui/GuiWindow.py @@ -43,6 +43,7 @@ class GuiWindow(wx.ScrolledWindow): def resize(self, newSize): self.size = newSize; self._updateScrollBars(); self.SetMinSize(self.size); self.SetSize(wx.DefaultCoord, wx.DefaultCoord, *self.size); + self.SetMinSize(self.parent.GetSize()); self.SetSize(wx.DefaultCoord, wx.DefaultCoord, *self.parent.GetSize()) curWindow = self while curWindow != None: curWindow.Layout(); curWindow = curWindow.GetParent(); @@ -51,6 +52,7 @@ class GuiWindow(wx.ScrolledWindow): # __init__(self, parent, pos, scrollStep, style=0): initialisation method def __init__(self, parent, pos, scrollStep, style=0): super().__init__(parent, pos=pos, style=style) if style != 0 else super().__init__(parent, pos=pos) + self.parent = parent self.pos, self.scrollFlag, self.scrollStep, self.size = pos, False, scrollStep, None for eventType, f in ( (wx.EVT_CHAR, self.onKeyboardInput), (wx.EVT_CLOSE, self.onClose), (wx.EVT_ENTER_WINDOW, self.onEnterWindow),