Hi Martin,

On Tue, Mar 9, 2010 at 7:22 PM, Martin Beckett <m...@mgbeckett.com> wrote:

> On this topic, is there a way of having an eventHandler remove itself?
> I want a one-shot selection of a point.
>
> I can't call removeHandler(this) inside the handler and there is no
> callback function I can pass to the handler to be triggered when handle()
> returns true.
>
> Any suggestions?
>

You'll need to do the call to remove the event handler from outside the
Viewer::eventTraversal() by adding some kind of removal code into the frame
loop, or create custom osg::Operation for doing th removal and add this to
the viewer via viewer.addUpdateOperation();  You can set up osg::Operation
so that they themselves are automatically removed after they have been run.

Or... just don't use an event handler, just have you own custom event
handling code in your frame loop in addition to the
Viewer::eventTraversals();

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to