[vtkusers] focus with tcl/tk and vtkRenderWindow

Odet Christophe christophe.odet at creatis.insa-lyon.fr
Thu Jul 5 08:45:31 EDT 2001


Hi David,

In order to overcome this problem I use a tk binding on the window TkRendeWindow containing it
for all the keypress. Two lines seem to work well:

  vtkTkRenderWidget .${name}.c.rw -rw ${name}_renWin -width $width -height $height
# This 2 lines for getting keypress in the natural vtkinteractor and forbidding e (for exit)
  bind .${name}.c.rw <KeyPress> "if {\[string first %A \"eE\"] == -1} {
     [${name}_iren GetInteractorStyle] OnChar 0 0 %A 0 } "
  bind .${name}.c.rw <Enter> "focus .${name}.c.rw "

All the fonctionnalities are available.
I hope this will help.

Christophe

----- Message d'origine -----
De : David E. Jones <jonesde at rainbow.es.dupont.com>
À : <vtkusers at public.kitware.com>
Envoyé : jeudi 5 juillet 2001 13:38
Objet : [vtkusers] focus with tcl/tk and vtkRenderWindow


> I'm using a vtkRenderWindow in a tcl/tk program.   The tcl focus command
>
>  won't transfer focus from a vtkRenderWindow to a tk widget because the
>  vtkRenderWindow isn't under tk's control.   Is there some way to do
> this ?
>  Maybe there is a way to have tcl/tk recognize a "foreign" window id and
>
>   be able to exercise some control over the window ?
>
>  I know about vtkTkRenderWidget but I can't use it because it doesn't
>  have "joystick" interaction mode.   Also,  I've already got a lot of
> code
>  based on vtkRenderWindow and vtkInteractorStyleUser.
>
> Thanks in advance,
> Dave
>
> --
> David E Jones
> Du Pont Central Research
> Experimental Station, Bldg 320
> Wilmington, DE 19880-0320
>
>
>





More information about the vtkusers mailing list