I have figured out a hack to resize 2D widgets when the window resizes. I am sure that there is <br>a better way to do it, but unfortunately no one responded to my earlier query.<br><br>In your resize window handler function, add the following code<br>
<br>char TestLineWidgetEventLog[] =<br>"# StreamVersion 1\n"<br>"MiddleButtonPressEvent 148 150 0 0 0 0 i\n"<br>"MiddleButtonReleaseEvent 136 150 0 0 0 0 i\n"<br>;<br><br>void CYourView::OnSize(UINT nType, int cx, int cy)<br>
{<br> ....<br> // play a short sequence of events. A hack to get widget to resize<br> recorder = vtkInteractorEventRecorder::New();<br> recorder->SetInteractor(Interactor);<br> recorder->ReadFromInputStringOn();<br>
recorder->SetInputString(TestLineWidgetEventLog);<br> recorder->Play();<br> recorder->Off();<br> recorder->Delete();<br> }<br> }<br><br><br>This will actually resize all the widgets in your window<br>
<br>Cheers,<br><br>Imran<br>