Two issues with user data

hpesoj

10-04-2009 00:03:50

More problems here :P.

Firstly, regarding WidgetUserData::getUserData, it seems quite odd to me that you have provided these template functions for directly extracting the contents of the stored user data but -- and correct me if I'm wrong -- you haven't provided a means to simply extract the MyGUI::Any object. This makes it impossible to retrieve user data if you don't currently know what type of data is stored there.

My second problem is regarding MenuItem::setItemData; as far as I can tell, calling this function stores user data in the parent MenuCtrl, and so is completely separate from the main widget user data. Is this data linked directly with the MenuItem, or with the index of the MenuCtrl? I'm not sure why you are doing this, so if you could enlighten me that'd be nice :).

Thanks for your time.

Joe

nikki

13-04-2009 15:13:31

Firstly, regarding WidgetUserData::getUserData, it seems quite odd to me that you have provided these template functions for directly extracting the contents of the stored user data but -- and correct me if I'm wrong -- you haven't provided a means to simply extract the MyGUI::Any object. This makes it impossible to retrieve user data if you don't currently know what type of data is stored there.
A dirty workaround would be to store a MyGUI::Any as the userdata itself. ;)