def set_textctrl_background_color(textctrl, mode, tooltip=None):
if mode == 'ok':
color = (255,255,255)
elif mode == 'enter-needed':
color = (200,255,200)
elif mode == 'invalid':
color = (255,200,200)
textctrl.SetBackgroundColour(color)
textctrl.Refresh()
if tooltip is not None and not isinstance(tooltip, wx.ToolTip):
tooltip = wx.ToolTip(tooltip)
textctrl.SetToolTip(tooltip)
force_textctrl_color_update(textctrl)
评论列表
文章目录