]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix for wxPyTipProvider. Now it is possible to derive from it and
authorRobin Dunn <robin@alldunn.com>
Sat, 20 Jul 2002 19:45:24 +0000 (19:45 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 20 Jul 2002 19:45:24 +0000 (19:45 +0000)
implement GetTip.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/misc2.i
wxPython/src/msw/misc2.cpp
wxPython/src/msw/misc2.py

index 2aa156803dc289d3f17fc3ec5bcb90aa28b9f5a2..5e080982f0def9c7df05324a640b78fd0b6553de 100644 (file)
@@ -468,6 +468,9 @@ IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip);
 class wxPyTipProvider : public wxTipProvider {
 public:
     wxPyTipProvider(size_t currentTip);
+
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyTipProvider)"
 };
 
 
index 51c47f1f95c845d7584f5ac20f0de836c9bca345..2e05528dfe18dcc36d3f6307dd8c513230d173ac 100644 (file)
@@ -3632,6 +3632,44 @@ static PyObject *_wrap_new_wxPyTipProvider(PyObject *self, PyObject *args, PyObj
     return _resultobj;
 }
 
+#define wxPyTipProvider__setCallbackInfo(_swigobj,_swigarg0,_swigarg1)  (_swigobj->_setCallbackInfo(_swigarg0,_swigarg1))
+static PyObject *_wrap_wxPyTipProvider__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxPyTipProvider * _arg0;
+    PyObject * _arg1;
+    PyObject * _arg2;
+    PyObject * _argo0 = 0;
+    PyObject * _obj1 = 0;
+    PyObject * _obj2 = 0;
+    char *_kwnames[] = { "self","self","_class", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxPyTipProvider__setCallbackInfo",_kwnames,&_argo0,&_obj1,&_obj2)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyTipProvider_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyTipProvider__setCallbackInfo. Expected _wxPyTipProvider_p.");
+        return NULL;
+        }
+    }
+{
+  _arg1 = _obj1;
+}
+{
+  _arg2 = _obj2;
+}
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxPyTipProvider__setCallbackInfo(_arg0,_arg1,_arg2);
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
 static void *SwigwxGenericDragImageTowxObject(void *ptr) {
     wxGenericDragImage *src;
     wxObject *dest;
@@ -10537,6 +10575,7 @@ static PyMethodDef misc2cMethods[] = {
         { "new_wxDragString", (PyCFunction) _wrap_new_wxDragString, METH_VARARGS | METH_KEYWORDS },
         { "new_wxDragIcon", (PyCFunction) _wrap_new_wxDragIcon, METH_VARARGS | METH_KEYWORDS },
         { "new_wxDragImage", (PyCFunction) _wrap_new_wxDragImage, METH_VARARGS | METH_KEYWORDS },
+        { "wxPyTipProvider__setCallbackInfo", (PyCFunction) _wrap_wxPyTipProvider__setCallbackInfo, METH_VARARGS | METH_KEYWORDS },
         { "new_wxPyTipProvider", (PyCFunction) _wrap_new_wxPyTipProvider, METH_VARARGS | METH_KEYWORDS },
         { "wxTipProvider_GetCurrentTip", (PyCFunction) _wrap_wxTipProvider_GetCurrentTip, METH_VARARGS | METH_KEYWORDS },
         { "wxTipProvider_GetTip", (PyCFunction) _wrap_wxTipProvider_GetTip, METH_VARARGS | METH_KEYWORDS },
index 5d6dbb22f3f6a9556ea01743494de33960bdd47d..6d83b5cd64edea8b92d5f6e4ac65c73a6aad1762 100644 (file)
@@ -187,12 +187,16 @@ class wxPyTipProviderPtr(wxTipProviderPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
+    def _setCallbackInfo(self, *_args, **_kwargs):
+        val = apply(misc2c.wxPyTipProvider__setCallbackInfo,(self,) + _args, _kwargs)
+        return val
     def __repr__(self):
         return "<C wxPyTipProvider instance at %s>" % (self.this,)
 class wxPyTipProvider(wxPyTipProviderPtr):
     def __init__(self,*_args,**_kwargs):
         self.this = apply(misc2c.new_wxPyTipProvider,_args,_kwargs)
         self.thisown = 1
+        self._setCallbackInfo(self, wxPyTipProvider)