This is a better solution than mine. Although there should ideally be something more<br>evident in the design to implement resizing of widget representations for adjusting to<br>resize of window.<br><br>Thanks for this.<br>
<br>Imran<br><br><br><div class="gmail_quote">On Fri, May 21, 2010 at 1:34 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="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;">Okay, I was able to finally get this to work. Instead of calling Render on the slider widget, it updates properly if I call<div><br></div><div>sliderRep.Modified()</div><div><br></div><div>
after I change those point coordinates and before I call Render() on the render window.</div><div><br></div><div>I&#39;m not sure exactly how this can help in your situation, Imran...</div><div><br></div><div>-Eric</div><div>
<br><div><div><div></div><div class="h5"><div>On May 21, 2010, at 1:16 PM, Eric E. Monson wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div class="h5"><div style="word-wrap: break-word;">The other place where I run into trouble with this issue is when I try to change the size/placement of the widget. I make calls like this (sliderRep is an instance of vtkSliderRepresentation2D, python code):<div>
<br></div><div><div>sliderRep.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay()</div><div>sliderRep.GetPoint1Coordinate().SetValue(0.1 ,0.07)</div><div>sliderRep.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay()</div>
<div>sliderRep.GetPoint2Coordinate().SetValue(0.9, 0.07)</div><div><br></div><div>but even after trying the naive methods of re-rendering the widget and window:</div><div><br></div><div><div>sliderWidget.Render()</div><div>
renderWindow.Render()</div><div><br></div><div>the position of the slider isn&#39;t updated until I interact with the window.</div><div><br></div><div>-Eric</div><div><br></div></div><div><div>On May 21, 2010, at 12:41 PM, imran khan wrote:</div>
<br><blockquote type="cite">Karthik:<br><br>The issue is that the widget maintains its absolute size when the window is resized. It sizes up correctly when<br>a mouse interaction happens within the rendered area. So what my hack is doing is mimicking a middle button<br>

press which indirectly resizes the widgets correctly.<br><br>It is not clear what changing the Point1Coordinate and a Point2Coordinate in normalized coordinates would do. As<br>I want to maintain the same normalized locations when the window resizes.<br>

<br>Imran<br><br><div class="gmail_quote">On Fri, May 21, 2010 at 12:08 PM, Karthik Krishnan <span dir="ltr">&lt;<a href="mailto:karthik.krishnan@kitware.com" target="_blank">karthik.krishnan@kitware.com</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;">
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><font color="#888888">karthik</font><div><div></div><div><br><br><br><br></div></div></blockquote></div>
</blockquote></div><br></div></div></div></div><div class="im">_______________________________________________<br>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>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><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></blockquote></div><br></div></div></blockquote></div><br>