Page 1 of 1

PyCEGUI No to_python (by-value) converter MouseCursor

Posted: Mon Jun 11, 2012 10:07
by dermont
There appears to be a problem in the python module returning a MouseCursor:

Code: Select all

PyCEGUI.System.getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage("TaharezLook/MouseArrow")

>>> InitializationError: No to_python (by-value) converter found for C++ type: CEGUI::MouseCursor


From a quick look at your bindings it chokes on returning a bp::copy_const_reference (copy ctor ?) but MouseCursor has been declared as nobcopyable in your bindings.

GUIContext.pypp.cpp

Code: Select all

        { //::CEGUI::GUIContext::getMouseCursor
            typedef ::CEGUI::MouseCursor const & ( ::CEGUI::GUIContext::*getMouseCursor_function_type )(  ) const;
            GUIContext_exposer.def(
                "getMouseCursor"
                , getMouseCursor_function_type( &::CEGUI::GUIContext::getMouseCursor )
                , bp::return_value_policy< bp::copy_const_reference >() );
        }


generateCEGUI.py

Code: Select all

    # CEGUIMouseCursor.h
    mouseCursor = CEGUI_ns.class_("MouseCursor")
    mouseCursor.include()
    mouseCursor.noncopyable = True


I think, but could be wrong, the solution would be to exclude the const GUIContext::getMouseCursor method in your bindings.

Re: PyCEGUI No to_python (by-value) converter MouseCursor

Posted: Thu Jun 14, 2012 11:31
by Kulik
Hmm, this really looks like a bug in mercurial PyCEGUI. I wonder if the same doesn't apply to 0.7 release PyCEGUI.

Will make some investigations of this later, thanks for reporting!

EDIT: mantis ticket: http://cegui.org.uk/mantis/view.php?id=836