回答編集履歴

1

公式ドキュメント引用・リンク追記

2021/06/12 11:01

投稿

teamikl
teamikl

スコア8664

test CHANGED
@@ -29,3 +29,37 @@
29
29
  - gsizer.Fit( self.mainPanel ) ... mainPanel のサイズを gsizer に合わせます
30
30
 
31
31
  - self.mainPanel.Fit() ... MinSize (もしくは、適度なサイズ) に調整されます
32
+
33
+
34
+
35
+ ----
36
+
37
+ 参考
38
+
39
+
40
+
41
+ - [Window.Fit](https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.Fit)
42
+
43
+ - [Window.Layout](https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.Layout)
44
+
45
+
46
+
47
+ - [Window.SetAutoLayout](https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.SetAutoLayout)
48
+
49
+ > Determines whether the Layout function will be called automatically **when the window is resized**
50
+
51
+
52
+
53
+ 自動でレイアウトされるのは、リサイズ時。ウィジェット生成時は通知されない。
54
+
55
+
56
+
57
+ - [Sizer.Fit](https://wxpython.org/Phoenix/docs/html/wx.Sizer.html#wx.Sizer.Fit)
58
+
59
+
60
+
61
+ > Tell the sizer to resize the window so that its client area matches **the sizer’s minimal size**
62
+
63
+
64
+
65
+ MinSize を設定した mainPanel は sizer ではなく window 側。