Hi, you can issue a virtual 'ESC' keypress using the following code. This emulates that a keypress has been done even you never touched the keyboard. Maybe if you issue this to your window in code when box3 is clicked the window will be closed.
osgViewer::Viewer::Windows windows; viewer->getWindows (windows); osgViewer::GraphicsWindow * win = *windows.begin (); win->getEventQueue()->keyPress( osgGA::GUIEventAdapter::KEY_Escape ); win->getEventQueue()->keyRelease( osgGA::GUIEventAdapter::KEY_Escape); Dimi ----- Original Message ---- From: R. Morris <russell.co...@gmail.com> To: OpenSceneGraph Users <osg-users@lists.openscenegraph.org> Sent: Wednesday, February 11, 2009 9:40:37 PM Subject: Re: [osg-users] Closing Windows The code works fine. I'm trying to figure out how to close the window once box3 is clicked. The callback on the box is fine, it calls other functions without issue, I just don't know how to force the window to close via code. The ESC works, just need to do it via something like rViewer->isDone(true) (this doesn't work for me). Hope this clears it up! -Russ _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org