[vtkusers] giving renderwindow a name

David Doria daviddoria+vtk at gmail.com
Tue Jan 5 14:07:06 EST 2010


On Tue, Jan 5, 2010 at 11:25 AM, michiel mentink
<michael.mentink at st-hughs.ox.ac.uk> wrote:
> I'm trying to give a renderwindow a title.
>
> I'm using the following code to create a window. So far so good.
>
>   // create a renderer
>   vtkSmartPointer<vtkRenderer> renderer =
>     vtkSmartPointer<vtkRenderer>::New();
>   renderer->AddActor(actor);
>
>   // create a render window
>   vtkSmartPointer<vtkRenderWindow> renwin =
>     vtkSmartPointer<vtkRenderWindow>::New();
>   renwin->AddRenderer(renderer);
>
>
>   // create an interactor
>   vtkSmartPointer<vtkRenderWindowInteractor> iren =
>     vtkSmartPointer<vtkRenderWindowInteractor>::New();
>   iren->SetRenderWindow(renwin);
>     renwin->SetSize(640, 480);
>
>   iren->Initialize();
>   iren->Start();
>
>
> ///////////end code////////
>
> Before iren->initialize, I tried the following:
>
>       iren->SetWindowInfo( "window1" );
>      renwin->SetWindowInfo( "window1");
>
> and also ->SetWindowId("window1");
> and ->SetWindowName("window1");
>
> but it keeps giving me error messages upon compiling:
>
> ‘class vtkRenderWindowInteractor’ has no member named ‘SetWindowInfo’
> or
> error: ‘renWin’ was not declared in this scope
>
>
> It's probably a simple mistake, but I'm still beginning to understand VTK.
> Can anybody point me in the right direction?
>
> Kind regards, Michael
>
>

I setup an example if anyone cares to play with it to get it to work:
http://www.cmake.org/Wiki/VTK/Examples/WindowTitle

Thanks,

David



More information about the vtkusers mailing list