[vtk-developers] vtkBorderWidget events

Leonardo M. Ramé l.rame at griensu.com
Tue Oct 26 09:18:13 EDT 2010


On 2010-10-26 10:00:09 -0300, Leonardo M. Ramé wrote:
> On 2010-10-26 08:42:39 -0400, David Doria wrote:
> > On Tue, Oct 26, 2010 at 8:09 AM, Leonardo M. Ramé <l.rame at griensu.com>wrote:
> > 
> > > Hi, I created a vtkBorderWidget by changing its
> > > vtkBorderRepresentation's to "SetCoordinateSystemToViewport", and it
> > > draws correctly. My problem is, after using that setting, it doesn't
> > > fires any event when I click or drag over it.
> > >
> > > Does anyone knows why?
> > > --
> > > Leonardo M. Ramé
> > >
> > 
> > Leonardo,
> > 
> > I think this is a question better posed to the users mailing list.
> 
> Thanks David, I'm posting here because I didn't get a respinse in users
> mailing list. :(
> 
> > How do you know it doesn't fire any events? Which ones did you try to catch?
> 
> I have a subclassed vtkCommand to which I attached my widget by using
> AddObserver. It fires an event just after I create the widget's
> representation, if I add the vtkCommand:AnyEvent observer. But, after
> that, I can't catch events anymore.

I found that the events are fired before I set myWidget->On; or
myWidget->EnabledOn;. After that, no event is fired.

This way events are not catched:

lWidget->On;
lWidget->AddObserver(vtkCommand::AnyEvent, widgetCallback);


Here, the events ModifiedEvent and EnabledEvent are catched, I think
those are fired before the lWidget->On;, then no other event is catched. 

lWidget->AddObserver(vtkCommand::AnyEvent, widgetCallback);
lWidget->On;



-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com



More information about the vtk-developers mailing list