I&#39;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&#39;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">&lt;<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>&gt;</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&#39;ve been having the same problem.<br>
<br>
I hope you&#39;re right that there is a more proper solution out there somewhere, but it&#39;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>
&gt; I have figured out a hack to resize 2D widgets when the window resizes. I am sure that there is<br>
&gt; a better way to do it, but unfortunately no one responded to my earlier query.<br>
&gt;<br>
&gt; In your resize window handler function, add the following code<br>
&gt;<br>
&gt; char TestLineWidgetEventLog[] =<br>
&gt; &quot;# StreamVersion 1\n&quot;<br>
&gt; &quot;MiddleButtonPressEvent 148 150 0 0 0 0 i\n&quot;<br>
&gt; &quot;MiddleButtonReleaseEvent 136 150 0 0 0 0 i\n&quot;<br>
&gt; ;<br>
&gt;<br>
&gt; void CYourView::OnSize(UINT nType, int cx, int cy)<br>
&gt;     {<br>
&gt;     ....<br>
&gt;          // play a short sequence of events. A hack to get widget to resize<br>
&gt;         recorder = vtkInteractorEventRecorder::New();<br>
&gt;         recorder-&gt;SetInteractor(Interactor);<br>
&gt;         recorder-&gt;ReadFromInputStringOn();<br>
&gt;         recorder-&gt;SetInputString(TestLineWidgetEventLog);<br>
&gt;         recorder-&gt;Play();<br>
&gt;         recorder-&gt;Off();<br>
&gt;         recorder-&gt;Delete();<br>
&gt;         }<br>
&gt;     }<br>
&gt;<br>
&gt;<br>
&gt; This will actually resize all the widgets in your window<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Imran<br>
&gt; _______________________________________________<br>
<div class="im">&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; 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>
&gt;<br>
</div>&gt; 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">&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
</div>&gt; <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>