回答編集履歴
1
公式ドキュメント引用・リンク追記
answer
CHANGED
@@ -13,4 +13,21 @@
|
|
13
13
|
|
14
14
|
- self.Layout() ... リサイズ時と同じ挙動、ウィンドウ幅いっぱいに広がる
|
15
15
|
- gsizer.Fit( self.mainPanel ) ... mainPanel のサイズを gsizer に合わせます
|
16
|
-
- self.mainPanel.Fit() ... MinSize (もしくは、適度なサイズ) に調整されます
|
16
|
+
- self.mainPanel.Fit() ... MinSize (もしくは、適度なサイズ) に調整されます
|
17
|
+
|
18
|
+
----
|
19
|
+
参考
|
20
|
+
|
21
|
+
- [Window.Fit](https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.Fit)
|
22
|
+
- [Window.Layout](https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.Layout)
|
23
|
+
|
24
|
+
- [Window.SetAutoLayout](https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.SetAutoLayout)
|
25
|
+
> Determines whether the Layout function will be called automatically **when the window is resized**
|
26
|
+
|
27
|
+
自動でレイアウトされるのは、リサイズ時。ウィジェット生成時は通知されない。
|
28
|
+
|
29
|
+
- [Sizer.Fit](https://wxpython.org/Phoenix/docs/html/wx.Sizer.html#wx.Sizer.Fit)
|
30
|
+
|
31
|
+
> Tell the sizer to resize the window so that its client area matches **the sizer’s minimal size**
|
32
|
+
|
33
|
+
MinSize を設定した mainPanel は sizer ではなく window 側。
|