<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5"><br>this is because in the parent class, the constructor sets a specific static<br>
(non-virtual) method:<br>
<br>
vtkSphereWidget::vtkSphereWidget()<br>
{<br>
this->State = vtkSphereWidget::Start;<br>
this->EventCallbackCommand->SetCallback(vtkSphereWidget::ProcessEvents);<br>
<br>
MySphereWidget would need to implement the static method ProcessEvents:<br>
<br>
void MySphereWidget::ProcessEvents(vtkObject* vtkNotUsed(object), unsigned long event,<br>
void* clientdata, void* vtkNotUsed(calldata))<br>
{<br>
MySphereWidget* self = reinterpret_cast<MySphereWidget *>( clientdata );<br>
<br>
and implement the constructor:<br>
<br>
MySphereWidget::MySphereWidget()<br>
{<br>
this->EventCallbackCommand->SetCallback(MySphereWidget::ProcessEvents);<br>
}<br>
<br>
Dean<br>
</div></div></blockquote></div><br><div>Hi Dean,</div><div><br></div><div>Why would they do this instead of letting you override the On*() functions as usual?</div><div><br></div><div><div>I tried to do what you suggested:</div>
<div><a href="http://www.vtk.org/Wiki/VTK/Examples/Widgets/SphereWidgetEvents">http://www.vtk.org/Wiki/VTK/Examples/Widgets/SphereWidgetEvents</a></div><div><br></div><div>But I get this error:</div><div><br></div><div><div>
error: no matching function for call to 'vtkCallbackCommand::SetCallback(<unresolved overloaded function type>)'</div><div>note: candidates are: virtual void vtkCallbackCommand::SetCallback(void (*)(vtkObject*, long unsigned int, void*, void*))</div>
<div><br></div><div>There should be a matching function because we just defined it, right?</div><div><br></div></div>Thanks,<br><br>David<br></div>