[vtkusers] Resizing vtkSliderRepresentation2D
Eric E. Monson
emonson at cs.duke.edu
Fri May 21 11:46:27 EDT 2010
Hey Imran,
Thanks for passing this along -- I've been having the same problem.
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.
Talk to you later,
-Eric
------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group
On May 20, 2010, at 9:30 PM, imran khan wrote:
> I have figured out a hack to resize 2D widgets when the window resizes. I am sure that there is
> a better way to do it, but unfortunately no one responded to my earlier query.
>
> In your resize window handler function, add the following code
>
> char TestLineWidgetEventLog[] =
> "# StreamVersion 1\n"
> "MiddleButtonPressEvent 148 150 0 0 0 0 i\n"
> "MiddleButtonReleaseEvent 136 150 0 0 0 0 i\n"
> ;
>
> void CYourView::OnSize(UINT nType, int cx, int cy)
> {
> ....
> // play a short sequence of events. A hack to get widget to resize
> recorder = vtkInteractorEventRecorder::New();
> recorder->SetInteractor(Interactor);
> recorder->ReadFromInputStringOn();
> recorder->SetInputString(TestLineWidgetEventLog);
> recorder->Play();
> recorder->Off();
> recorder->Delete();
> }
> }
>
>
> This will actually resize all the widgets in your window
>
> Cheers,
>
> Imran
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list