views:

59

answers:

1

I have something like this:

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())
            ....

Now, I need to have APanel seperate, because the text controls have to be changed dynamically.

Problem is, the Validate() method of Validator never gets called.

I've tried passing the flag wx.WS_EX_VALIDATE_RECURSIVELY to wx.Dialog.__init__, and also tried overriding the Validate() method of ADialog to call Validate() on APanel, and then overridden the Validate() method of APanel to call the validators of each text control, but that didn't work either.

os: Windows 7
python version: 2.5.4
wxPython version: 2.8.10

+3  A: 

wx.WS_EX_VALIDATE_RECURSIVELY is an extended style, so you need to set it with SetExtraStyle, not by passing it to the base class' _init_

RobinDunn