SetWindowName() for vtkWin32OpenGLRenderWindow
Reported in 2005, still an issue in 8.2.
Quoting from https://public.kitware.com/pipermail/vtk-developers/2005-June/018846.html:
If you set the window name in Windows before the the window is actually created, the name is obliterated. For example, the following code fragment produces a window with the name "Visualization Toolkit - Win32OpenGL #1":
vtkRenderWindow* renWin = vtkRenderWindow::New();
renWin->SetWindowName( "My Window Name" );
...
renWin->Render();
// window has wrong title
If you instead set the window name after the window has been created, the name will be set properly:
vtkRenderWindow* renWin = vtkRenderWindow::New();
...
renWin->Render();
renWin->SetWindowName( "My Window Name" );
//window has correct title
The problem lies in vtkWin32OpenGLRenderWindow::CreateAWindow(). Here the title of the window is set without regard to the current value of the WindowName member variable.
To fix the problem I suggest setting the WindowName to "Visualization Toolkit - Win32OpenGL #" in the constructor. When CreateAWindow() is called, if WindowName has not been changed then append the number of this window to the WindowName as is done currently. Otherwise, leave the name as it is.
Are there any objections to this fix or better suggestions?
Brandon Lloyd