Hi Sashidhar,

Which version of the OSG are you using?  I did some work in the 2.1.x
series to help make adding/removing views a bit more robust.

You call of viewer.frame() is something that you should drop as the
event handler you've written will be called from within frame, so you
are in effect creating a loop that if one is not really careful will
result in problems such as an infinite loop.  The call itself should
be required as you are already within a frame.

Do you have any global references to the View that you are removing?

Robert.

On 10/19/07, Sashidhar Guntury <[EMAIL PROTECTED]> wrote:
> Hi!
>
>           I'm using the composite viewer, to make a program wherein there
> are two views of the entire scene. The main view is spread across the screen
> while the other view lies in a corner. I want the the smaller view to
> disappear when I click on it (left click.)  My handle function is --
>
>  bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
>     {
>         osgViewer::View* view =
> dynamic_cast<osgViewer::View*>(&aa);
>         if (!view) return false;
>
>         if (ea.getEventType() ==
> osgGA::GUIEventAdapter::RELEASE){
>                     viewer.removeView(topView);
>                     viewer.frame();
>                     cout << "Killed the map!!" << endl;
>         }
>         return false;
>     }
>
>                                        But when I click on
> the smaller view, it prints "Killed the map", but the view still remains
> there. Why does it happen that way? Isn't viewer.frame() supposed to display
> a completely new, updated frame?
>
>                                 thanks
>
> Bye
> Sashidhar
>
> _______________________________________________
> 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

Reply via email to