Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wxPython验证程序未为对话的孙子调用_Python_User Interface_Wxpython - Fatal编程技术网

wxPython验证程序未为对话的孙子调用

wxPython验证程序未为对话的孙子调用,python,user-interface,wxpython,Python,User Interface,Wxpython,我有这样的想法: class ADialog(wx.Dialog): def __init__(self, parent, *args, **kwargs): ... self.editor = APanel(parent=self) ... ... class APanel(wx.Panel): def CreatePanel(self, *args, **kwargs): ... sel

我有这样的想法:

class ADialog(wx.Dialog):
    def __init__(self, parent, *args, **kwargs):
        ...
        self.editor = APanel(parent=self)
        ...
    ...

class APanel(wx.Panel):
    def CreatePanel(self, *args, **kwargs):
        ...
        self.textCtrls = []
        for (key, val) in zip(foo, bar):
            ...
            box = wx.TextCtrl(parent=self, value=val, validator=Validator())
            ....
现在,我需要一个单独的面板,因为文本控件必须动态地更改

问题是,
Validator
Validate()
方法从未被调用

我已经尝试将标志
wx.WS\u EX\u VALIDATE\u递归地传递给
wx.Dialog.\uuu init\uuuu
,并且还尝试重写adilog的
VALIDATE()
方法来调用APanel上的
VALIDATE()
,然后重写APanel的
VALIDATE()
方法来调用每个文本控件的验证器,但这也不起作用

操作系统:Windows 7
python版本:2.5.4

wxPython版本:2.8.10

wx.WS\u EX\u VALIDATE\u递归地是一种扩展样式,因此您需要使用SetExtraStyle对其进行设置,而不是通过将其传递给基类“\uuu init\uuuu”

wx.WS\u EX\u VALIDATE\u递归地是一种扩展样式,因此您需要使用SetExtraStyle对其进行设置,而不是通过将其传递给基类“\uu init”__