I'm afraid I still don't understand exactly what you're describing.
There is nothing wrong with the code below, other than the fact you're
creating a Viewer object on the heap (requiring you to manually delete
it before main() returns). I'm still not even entirely sure if the
problem is related to osgWidget. :)

If you're saying that the ESC key in general doesn't work with your
application, it could be possible that a Callback somewhere is eating
the ESC key press so that it doesn't get passed up to the Viewer's
default handler.

On Tue, 2009-02-10 at 18:48 -0800, R. Morris wrote:
> Thanks for the responses, this is the basic code I'm using, there's
> more to it but this is the pertinent stuff:
> 
> rViewer = new osgViewer::Viewer();
>       
> wm = new osgWidget::WindowManager(
>       rViewer,
>       500.0f,
>       500.0f,
>       MASK_2D,
>       osgWidget::WindowManager::PD_NONE);
>       
>       
> osgWidget::Box *box = new osgWidget::Box("vbox1", osgWidget::Box::VERTICAL);
> osgWidget::Box *box2 = new osgWidget::Box("vbox2", osgWidget::Box::VERTICAL);
> osgWidget::Box *box3 = new osgWidget::Box("vbox3", osgWidget::Box::VERTICAL);
> 
> wm->addChild(box);
> wm->addChild(box2);
> wm->addChild(box3);
> 
> rViewer->setUpViewInWindow(500,500, wm->getWidth(), wm->getHeight());
>       
> cam = wm->createParentOrthoCamera();
> 
> osg::ClearNode *backdrop = new osg::ClearNode;
> backdrop->setClearColor(osg::Vec4(0.1,0.1,0.5,1.0));
> cam->addChild(backdrop);
> 
> rViewer->addEventHandler(new osgWidget::MouseHandler(wm));
> rViewer->addEventHandler(new osgWidget::KeyboardHandler(wm));
> 
> wm->resizeAllWindows();
> 
> rViewer->setCameraWithFocus(cam);
> rViewer->setSceneData(cam);
> 
> rViewer->run();
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to