Re: [osg-users] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?
HI Micahel, Are you talking about the following code in Viewer::eventTraversal() that responds to the osgGA::GUIEventAdapter::CLOSE_WINDOW event? for(itr = gw_events.begin(); itr != gw_events.end(); ++itr) { osgGA::GUIEventAdapter* event = itr-get(); switch(event-getEventType()) { case(osgGA::GUIEventAdapter::CLOSE_WINDOW): { bool wasThreading = areThreadsRunning(); if (wasThreading) stopThreading(); gw-close(); _currentContext = NULL; if (wasThreading) startThreading(); break; } default: break; } } It would be possible to make this optional, in the same way the EscapeSetsDone flag is used. Without any modifications to the OSG the way to avoid the issue would be to subclass from Viewer and override the eventTraversal() method. Robert. On 19 October 2012 13:36, michael kapelko korn...@gmail.com wrote: Hi. I've looked at the code (OSG 3.0.1) of Viewer::eventTraversal and noticed that it checks for CLOSE_WINDOW event and closes the window, so there's no way to prevent the window from closing. I've googled for window close prevention with no luck, too. Can we add something like Viewer::setSkipCloseWindowEvent to OSG? Thanks. ___ 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
Re: [osg-users] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?
Should I create the patch for the functionality? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?
Hi Mcahel, On 25 October 2012 12:04, michael kapelko korn...@gmail.com wrote: Should I create the patch for the functionality? The question is how one might go about the patch. One could modify ViewerBase to add g/setIgnoneCloseEvent(bool) and then read this in Viewer/CompositeViewer::eventTraversals() method, or go about it at the GraphicsWindow level by creating a window that doesn't have a close button. Is there a reason why you aren't doing the later? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?
Well, something like Alt-F4 is very-very intuitive, so forbidding it will increase the number of angry people :) ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?
Hi. I've looked at the code (OSG 3.0.1) of Viewer::eventTraversal and noticed that it checks for CLOSE_WINDOW event and closes the window, so there's no way to prevent the window from closing. I've googled for window close prevention with no luck, too. Can we add something like Viewer::setSkipCloseWindowEvent to OSG? Thanks. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org