MyGUI binding

DenisKoronchik

01-10-2009 11:29:59

There is a screenshot of workable python binding for MyGUI. Statistics overlays got from ogre sdk.


Now i have just little problems with some widgets.
Maybe anyone know how to resolve them.

When i'm adding items to MenuBar I have error:
Boost.Python.ArgumentError: Python argument types in
MenuCtrl.addItem(MenuBar, str, Enum, str)
did not match C++ signature:
addItem(class MyGUI::MenuCtrl {lvalue}, class Ogre::UTFString _name, struct MyGUI::MenuItemType _type=srs_engine._mygui_.Enum.Normal, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > _id='', class MyGUI::Any _data=<srs_engine._mygui_.Any object at 0x01CC74C8>)

Thats happens when calling:
menubar = window.createWidgetT("MenuBar", "MenuBar", mygui.IntCoord(0, 0, window.getWidth(), 25), mygui.Align())
item = menubar.addItem("test", mygui.MenuItemType.Normal, "id_test")


MenuCtrl is a base class for a MenuBar (class MenuBar : public MenuCtrl)

If i'm creating MenuCtlr class, then i have the same error:
Boost.Python.ArgumentError: Python argument types in
MenuCtrl.addItem(MenuCtrl, str, Enum, str)
did not match C++ signature:
addItem(class MyGUI::MenuCtrl {lvalue}, class Ogre::UTFString _name, struct MyGUI::MenuItemType _type=srs_engine._mygui_.Enum.Normal, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > _id='', class MyGUI::Any _data=<srs_engine._mygui_.Any object at 0x01CC74C8>)


That happens when calling:
menubar = window.createWidgetT("MenuCtrl", "MenuBar", mygui.IntCoord(0, 0, window.getWidth(), 25), mygui.Align())
item = menubar.addItem("test", mygui.MenuItemType.Normal, "id_test")


Also i have same error when add last parameter (mygui.Any) to item.addItem
Does anyone know what happends?

andy

02-10-2009 02:03:24

Looks like it needs a class UTFString to be passed as an argument -- something like:
item = menubar.addItem(ogre.UTFString("test"), mygui.MenuItemType.Normal, "id_test")
If this is the issue we can fix this in the code generator once you commit your changes (to make the conversion automatic)

Andy

DenisKoronchik

03-10-2009 06:35:45

That doesn't work. I tried that.
Don't know what is wrong.
I'll try to commit mygui generator this weekend. But that wouldn't finished version.