[vtkusers] Pls help! tk gui window disappears when i start the vtkRenderWindowInteractor

David Gobbi david.gobbi at gmail.com
Sun Mar 12 22:58:35 EDT 2017


Hi John,

Try running some of the Tcl gui examples to see if they work for you:
http://www.vtk.org/gitweb?p=VTK.git;a=tree;f=Examples/GUI/Tcl

The MaceTk.tcl example uses the vtkTkRenderWidget and eliminates the
vtkRenderWindowInteractor (since the vtkTkRenderWidget can handle
interaction all by itself).  That might be the best approach.

Unfortunately it's been a long, long time since I've written a vtk tcl
program so I can't give any specific advice on your code.

Regards,
 - David


On Sun, Mar 12, 2017 at 7:59 PM, john <jss at mensa.org.au> wrote:

> Hi good peoples,
>
> I'm wondering if someone can help me with an issue I'm seeing after
> updating an old vtk/tcl script to work with new VTK.
>
> The updates i made were things like changing the image pipeline
> filters to use SetInputConnection, instead of the deprecated old
> SetInput, and other minor updates.
>
> Basically, after the updates, the script works fine except that if when
> I add command to start the vtkRenderWindowInteractor, the little TK gui
> I've built does not appear.
>
> If i leave out the command to start the vtkRenderWindowInteractor
> (iren Start), then my tk gui appears, and I can use it to update some
> parameters of the renderer, and the the gui has a Render button
> which calls renWin Render to update the render window, and that's all
> working fine. But in this state, the render window cannot be interacted
> with. I can't zoom or rotate the view :-(
>
> Back when I had this working on VTK 4 or 5, I'm sure I had the TK gui
> up, and working, while at the same time being able to interact with the
> rendered window.
>
> I've tried with VTK 6.3 and 7.1, and behaviour is the same.
>
> I am basically a beginner with TCL/TK & VTK, so I've tried various
> things but had no success. I'm sure I must be just missing something
> relatively simple.
>
> I'd be happy with any solution that lets me use my tk gui, and the
> rendered window, even if only one window is active at a time, eg, I
> tried to get the "u" UserEvent of the vtkRenderWindowInteractor mapped
> so it would bring up the tk gui, but i couldn't get that to work.
> With most of the hacks i tried, the "u" button did nothing, and when i
> did get it to do something, all it did was bring up some blank windows
> called vtkInteract, which didn't seem to respond to anything i did with
> it.
>
> If i could get a key mapped which would pause the
> vtkRenderWindowInteractor and bring up my tk gui so i could make
> adjustments in the gui, then click a button to re-activate the
> vtkRenderWindowInteractor, that would be fine.
>
> If anyone can have a quick look at my script below, and tell me how to
> get my TK gui working whilst also being able to have interaction on the
> vtkRenderWindowInteractor working, that'd be awsm.
>
> Many thanks,
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170312/412cc957/attachment.html>


More information about the vtkusers mailing list