[vtkusers] RE: vtk, python20, TkRenderWidget, Win2000

Miller, James V (CRD) millerjv at crd.ge.com
Wed Mar 7 12:44:58 EST 2001

I pretty much figured the problem was with a tcl version mismatch between vtk and python.  I grabbed
the necessary headers for tcl 8.3 and rebuilt vtk with tcl8.3.  The TkRenderWidget.py script works
fine not.

'Course now I have another problem. I am trying to parent the TkRenderWidget off a Pmw.Notebook page
(that is inside a Pmw.PanelWidget). Has anyone tried this?  I just wind up a notebook page that
refuses to paint. It feels like the event system is not tied together properly and the first paint
event is not being processed. Perhaps the underlying objects are not being created. Maybe this is a
problem with Pmw? Or perhaps I need to send a couple of extra "pack" calls somewhere.


1) install.py could not copy the TkRenderWidget dll to the system directory because it could not find
it.  The working directory was e:\vtk\python and this library is in e:\vtkbin\lib.  So the install.py
does not know a separate build directory exists.

2) I tried to separate vtk the Tk internals on the windows side a couple of months ago.  I basically
tried to mimic what Dan Blezek did on the unix side. He basically restricted all calls to Tk to the
public interface.  My attempt to do this on Windows resulted in a TkWidget that would not parent
properly. I'll take another look at this sometime. I would REALLY like to remove the dependency on
the internals to tcl and tk.

3) If we could be successful at #2, then we wouldn't have to ship ANY tcl libraries with vtk.
Therefore, we could avoid one of the mismatches in tcl versions.  This makes sense to me since we do
not ship versions of python or java with vtk.

-----Original Message-----
From: David Gobbi [mailto:dgobbi at irus.rri.on.ca]
Sent: Wednesday, March 07, 2001 12:07 PM
To: Miller, James V (CRD)
Cc: VTK Mailing List
Subject: Re: vtk, python20, TkRenderWidget, Win2000

Hi Jim,

In case you didn't catch my reply to Prabhu, the problem lies with
the fact that graphics/vtkTkRenderWidget.cxx (and the other widgets)
require header files that don't come with the binary distribution of

Because Python-2.0 was built against tcl83.lib and tk83.lib, you
must specify (in pcmaker) that VTK is to be built against these libs.

Unfortunately pcmaker uses a fancy (and undocumented) set of rules for
searching for the tcl/tk header files.  If you tell it that the tcl/tk
libraries are

"C:\Program Files\Tcl\lib\tcl83.lib" 
"C:\Program Files\Tcl\lib\tk83.lib"

then it adds the following include directories to the build (I was
told this recently by Sebastien, but pcmaker has been doing this
for years)

"C:\Program Files\Tcl\include"
"C:\Program Files\Tcl\xlib"
"C:\Program Files\Tcl\win"
"C:\Program Files\Tcl\generic"

but the 'xlib', 'win', and 'generic' directories are only present
in the source distribution of tcl/tk.  (Note that you only require
these directories from the tk source, not the tcl source).  So,
what I do is copy these directories to my binary Tcl distribution.

So what should be done to make things easier?  First, someone should
take a good hard look at vtkTkRenderWidget.cxx to determine if it is
at all possible to remove its dependence on these 'internal' tk header
files (someone already did this fix for UNIX a while back).  Also,

1) a big, fat README.TXT should be added to the pcmaker directory that
   tells people in gory detail how to build against a specific
   tcl/tk distribution

2) the tcl/tk libs included with VTK should be updated to 8.3, so that
   VTK can be built against Python-2.0 with no hassle (at least until
   Python switches to a different Tcl/Tk version...).

 - David

  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Wed, 7 Mar 2001, Miller, James V (CRD) wrote:

> David and John,
> I saw that you werew changing the build process for vtk's python bindings on the pc, so I'll direct
> my question towards you.
> I am trying to build the python bindings for vtk on a pc with Windows2000 (shouldn't matter, but I
> have hit upon some other Win2000 library problems).  The normal python bindings work fine, but when
> use TkRenderWidget my program crashes.  The build process seems to build the TkRenderWidget dll
> Since this is the TkRenderWidget, my first assumption is that vtk and python are building with
> different versions of tcl/tk.  (Any time TkRenderWidget doesn't work in tcl the cause is usually
> vtk is built against one version and is executing against a different version.) By default, vtk is
> building with tcl 8.2 and it looks like python 2.0 ships with tcl 8.3.
> Are you building off the vtk repository with python 2.0? Do I need to go grab the source for tcl
> so I can build vtk with the same version of tcl that python ships with?
> Jim Miller
> _____________________________________
> Computer Graphics & Systems Program
> GE Corporate Research & Development
> Bldg. KW, Room C218B
> P.O. Box 8, Schenectady NY 12301
> millerjv at crd.ge.com <mailto:millerjv at crd.ge.com> 
> (518) 387-4005, Dial Comm: 8*833-4005, 
> Cell: (518) 505-7065, Fax: (518) 387-6981
>  <<James Miller (E-mail).vcf>> 
> begin 600 James Miller (E-mail).vcf
> M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..DUI;&QE<CM*86UE<PT*1DXZ
> M2F%M97, at 36EL;&5R("A%+6UA:6PI#0I/4D<Z1T4 at 0V]R<&]R871E(%(F1#M%
> M4TP-"E1%3#M73U)+.U9/24-%.B at U,3 at I(#,X-RTT,#`U#0I414P[5T]22SM6
> M3TE#13HJ.#,S+30P,#4-"E1%3#M73U)+.T9!6#HH-3$X*2`S.#<M-CDX,0T*
> M0412.U=/4DL[14Y#3T1)3D<]455/5$5$+5!224Y404),13H[0V]M<'5T97(@
> M1W)A<&AI8W,@)B!3>7-T96US(%!R;V=R86T[0DQ$1R!+5RP at 4DT@0S(Q.$(]
> M,$0],$%03R!";W@@.#M38VAE;F5C/0T*=&%D>3M.63LQ,C,P,3M5;FET960@
> M4W1A=&5S(&]F($%M97)I8V$-"DQ!0D5,.U=/4DL[14Y#3T1)3D<]455/5$5$
> M+5!224Y404),13I#;VUP=71E<B!'<F%P:&EC<R`F(%-Y<W1E;7, at 4')O9W)A
> M;3TP1#TP04),1$<@2U<L(%)-($,R,3A"/3!$/3!!4$\@0F]X(#@],$0]#0H]
> M,$%38VAE;F5C=&%D>2P at 3ED@,3(S,#$],$0],$%5;FET960 at 4W1A=&5S(&]F
> M($%M97)I8V$-"D5-04E,.U!2148[24Y415).150Z;6EL;&5R:G9`8W)D+F=E
> G+F-O;0T*4D56.C(P,#`P,3(X5#$V,C8U-EH-"D5.1#I60T%21`T*
> `
> end

More information about the vtkusers mailing list