>>
>> Ironically ctypes doesn't provide the necessary C API to do this. However
>> if (in Python) you can get the address of the real data structure as a
>> number (ctypes.addressof() ?) then you can create a sip.voidptr from it and
>> I can add the ctors to accept that.
>>
>
>
> import ctypes
> import sip
>
> class Display(ctypes.Structure):
> pass
>
> xlib = ctypes.CDLL('libX11.so.6')
> xlib.XOpenDisplay.restype = ctypes.POINTER(Display)
> xlib.XOpenDisplay.argtypes = [ctypes.c_char_p]
>
> display = xlib.XOpenDisplay(':0.0')
>
> dvp = ctypes.cast(display,ctypes.c_void_p)
> print dvp.value
> svp = sip.voidptr(dvp.value)
> print int(svp)
>
>
> I think the same thing could also be accomplished entirely in c++, not sure
> if
> it would be worth it.
>
> Matt
Great, thanks! So this looks like support for it can be added to PyQt4 in the
end...
Will somebody do it?
Btw. same integer like from your dvp.value and int(svp) is returned by this:
print ctypes.addressof(display.contents)
Does it have also some useful meaning?
Michal Krenek (Mikos)
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt