Home » U++ Library support » U++ Core » Need help...
Need help... [message #594] |
Sat, 14 January 2006 23:59 |
|
Hi all !
We try to create binding for Ultimate++ lib to Python.
Have more of widgets and non-gui classes (~70%)
Vector.sip
Values.sip
String.sip
Date.sip
Time.sip
Stream.sip
Color.sip
defs.sip
Path.sip
Image.sip
Draw.sip
Gtypes.sip
CtrlCore.sip
Callback.sip
PixelArray.sip
TopWindow.sip
Pusher.sip
LabelBase.sip
TheBack.sip
ArrayCtrl.sip
Bar.sip
LineEdit.sip
RichText.sip
RichTextView.sip
Uuid.sip
RichPara.sip
...but without Callback system
We using SIP to wrap the code.
this is a simple code ...
Callback TheBack::THE_Callback(void *args)
{
typedef TheBack CLASSNAME;
PyObject *p = (PyObject *)args;
Py_INCREF(p);
return callback1(this, &CLASSNAME::py_call,(void *)p);
}
void TheBack::py_call(void *data)
{
PyObject *p = (PyObject *)data;
PyObject *func = PyTuple_GetItem(p, 0);
PyObject *args = PyTuple_GetItem(p, 1);
PyObject *kw = PyTuple_GetItem(p, 2);
PyObject_Call(func, args, kw);
}
"return THISBACK1(py_call, (void *)p)"
This line is part from the Callback system,
take a pointer-function and return Callback object.
In Python i want wrap something like this :
def test(*args, **kw):
print "bla-bla"
module.THE_Callback(test,"some args...")
After that, call the Python function and pass her into "module.THE_Callback(...)"
but this not work.I dont know how to implement this in SIP.
In the moment "*args" from "module.THE_Callback" is not a valid python-function argument
Question is :
How to wrap this method "THE_Callback(void *args)" in SIP ?
p.s.
I will post some screenshots tomorrow.
[Updated on: Sun, 15 January 2006 00:22] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 04 22:08:54 CEST 2024
Total time taken to generate the page: 0.02254 seconds
|