@@ -103,33 +103,36 @@ def OnViewLog(self, event):
103103 self .notebook .show_tab (self ._window )
104104
105105
106- class _LogWindow (wx .TextCtrl ):
106+ class _LogWindow (wx .Panel ):
107107
108108 def __init__ (self , notebook , log ):
109- wx .TextCtrl .__init__ (
110- self , notebook , style = wx .TE_READONLY | wx .TE_MULTILINE )
109+ wx .Panel .__init__ (self , notebook )
110+ self . _output = wx . TextCtrl ( self , style = wx .TE_READONLY | wx .TE_MULTILINE )
111111 self ._log = log
112- self ._create_ui ()
113112 self ._add_to_notebook (notebook )
114113 self .SetFont (widgets .Font ().fixed_log )
114+ self .Bind (wx .EVT_SIZE , self .OnSize )
115115
116116 def _create_ui (self ):
117- sizer = wx .BoxSizer (wx .VERTICAL )
118- sizer .Add (self )
119- self .SetSizer (sizer )
117+ self .SetSizer (widgets .VerticalSizer ())
118+ self .Sizer .add_expanding (self ._output )
120119
121120 def _add_to_notebook (self , notebook ):
122121 notebook .add_tab (self , 'Log' , allow_closing = True )
123122 notebook .show_tab (self )
123+ self ._output .SetSize (self .Size )
124124
125125 def close (self , notebook ):
126126 notebook .delete_tab (self )
127127
128128 def update_log (self ):
129- self .SetValue (self ._decode_log (self ._log ))
129+ self ._output . SetValue (self ._decode_log (self ._log ))
130130
131131 def _decode_log (self , log ):
132132 result = ''
133133 for msg in log :
134134 result += _message_to_string (msg )
135135 return result
136+
137+ def OnSize (self , evt ):
138+ self ._output .SetSize (self .Size )
0 commit comments