I'm not sure what that code snippet does, but this is totally not the right way to resize any widget. <br><br>The slider representation has a Point1Coordinate and a Point2Coordinate. These define the end points of the slider (in normlized coordinates [-1, 1]). These iVars just aren't exposed. Modify the code yourself (or derive from vtkSliderRepresentation2D) and expose them so as to resize the widget.<br>
<br>Thanks<br>--<br>karthik<br><br><br><br><br><div class="gmail_quote">On Fri, May 21, 2010 at 9:16 PM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hey Imran,<br>
<br>
Thanks for passing this along -- I've been having the same problem.<br>
<br>
I hope you're right that there is a more proper solution out there somewhere, but it's nice to know that this works for now.<br>
<br>
Talk to you later,<br>
-Eric<br>
<br>
------------------------------------------------------<br>
Eric E Monson<br>
Duke Visualization Technology Group<br>
<br>
<br>
On May 20, 2010, at 9:30 PM, imran khan wrote:<br>
<br>
> 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>
> _______________________________________________<br>
<div class="im">> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
</div>> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<div class="im">><br>
> Follow this link to subscribe/unsubscribe:<br>
</div>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
_______________________________________________<br>
<div class="im">Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
</div>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<div class="im"><br>
Follow this link to subscribe/unsubscribe:<br>
</div><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><br>