Hi, I've a for cycle that create various buttons and add to them the callback. I want to pass to button also a string data.
I saw some examples and passes it with static string data = "test"; then in callback addCallback( new osgWidget::Callback(&WidgetManager::buttonPress,this,osgWidget::EVENT_MOUSE_PUSH,&data) ); The problem is that I want that "data" is different for every cycle, but it's static, then doesn't change. If I don't flag it static, it retreives an empty string. In my function "buttonPress" I retrieve my data value with: string *test= static_cast<std::string*>(ev.getData()); Can you help me? thank you! daniele ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35859#35859 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org