+
+ bool Disconnect(int id, int lastId = -1,
+ wxEventType eventType = wxEVT_NULL) {
+ return self->Disconnect(id, lastId, eventType,
+ (wxObjectEventFunction)
+ &wxPyCallback::EventThunker);
+ }
+
+ }
+};
+
+
+//----------------------------------------------------------------------
+
+class wxValidator : public wxEvtHandler {
+public:
+ wxValidator();
+ //~wxValidator();
+
+ wxValidator* Clone();
+ wxWindow* GetWindow();
+ void SetWindow(wxWindow* window);
+};
+
+%inline %{
+ bool wxValidator_IsSilent() {
+ return wxValidator::IsSilent();
+ }
+
+ void wxValidator_SetBellOnError(int doIt = TRUE) {
+ wxValidator::SetBellOnError(doIt);
+ }
+%}
+
+//----------------------------------------------------------------------
+%{
+class wxPyValidator : public wxValidator {
+ DECLARE_DYNAMIC_CLASS(wxPyValidator);
+public:
+ wxPyValidator() {
+ }
+// wxPyValidator(const wxPyValidator& other);
+
+ ~wxPyValidator() {
+ }
+
+ wxObject* wxPyValidator::Clone() const {
+ wxPyValidator* ptr = NULL;
+ wxPyValidator* self = (wxPyValidator*)this;
+
+ bool doSave = wxPyRestoreThread();
+ if (self->m_myInst.findCallback("Clone")) {
+ PyObject* ro;
+ ro = self->m_myInst.callCallbackObj(Py_BuildValue("()"));
+ SWIG_GetPtrObj(ro, (void **)&ptr, "_wxPyValidator_p");
+ }
+ // This is very dangerous!!! But is the only way I could find
+ // to squash a memory leak. Currently it is okay, but if the
+ // validator architecture in wxWindows ever changes, problems
+ // could arise.
+ delete self;
+
+ wxPySaveThread(doSave);
+ return ptr;