def _log(self, line, status='info'):
"""Writing given line to the log-textCtrl.
:Parameters:
- `line`: text to log
- `status`: status should be 'info' or 'error'. If 'info' the
text will be colored blue, if 'error' the text will
be red.
"""
start = self.txtCtrlLog.GetLastPosition()
self.txtCtrlLog.AppendText('%s\n' % line)
color = wx.BLACK
if status == 'info':
color = wx.BLUE
elif status == 'error':
color = wx.RED
self.txtCtrlLog.SetStyle(start, self.txtCtrlLog.GetLastPosition(),
wx.TextAttr(color))
评论列表
文章目录