All pastes #210635 Raw Edit

Stuff

public text v1 · immutable
#210635 ·published 2006-10-19 21:46 UTC
rendered paste body
template< class T >
T* extract_cegui_object(PyObject* obj)
{
    const char thisStr[] = "this";
    
    if (!PyObject_HasAttrString(obj, thisStr))
        return NULL;
        
    PyObject* thisAttr = PyObject_GetAttrString(obj, thisStr);
    if (thisAttr == NULL)
        return NULL;
        
    return reinterpret_cast< T* >(((PySwigObject*)thisAttr)->ptr);
}