mzGUI_standalone.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:multiplierz 作者: BlaisProteomics 项目源码 文件源码
def Validate(self, win):
        tc = self.GetWindow()
        val = tc.GetValue()
        nm = tc.GetName()

        try:
            v = self.func(val)
            if self.flag and v <= 0.0:
                wx.MessageBox("%s must be positive" % nm, "Error")
            elif v < 0.0:
                wx.MessageBox("%s must be non-negative" % nm, "Error")
            else:
                tc.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
                tc.Refresh()
                return True
        except ValueError:
            wx.MessageBox("%s is not a valid number" % nm, "Error")

        tc.SetBackgroundColour("YELLOW")
        tc.Clear()
        tc.SetFocus()
        tc.Refresh()
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号