[PYTHON IMAGE-SIG] tkImaging.c

Fred L. Drake fdrake@CNRI.Reston.Va.US
Thu, 3 Apr 1997 15:29:15 -0500 (EST)


Fredrik,
  I've got a question / suggestion / requirement for PIL & the Tk
interface.
  The current model for Tk with PIL is to build a separate version of
_tkinter; this can be highly problematic in some situations, such as
when you need to know that your Python installation is pristine (as is
the case here at CNRI).  I'd like to suggest another alternative.
  The only reason that _tkinter needs to be rebuilt is to add a new
type of photo image, at least as far as I can tell.  Is there any
reason that this must be done during the "app init" phase of Tcl/Tk
initialization and not after?  If not, then a new module, _tkimaging
perhaps, can be built and imported by ImageTk.  The initialization of
this new module should proceed as follows:

     1.  import _tkinter using the Python C API.
     2.  import _imaging using the Python C API.
     3.  create the new photo image handler using the Tk C API.

 Performing the imports before installing the new image type should be
sufficient since the image type does not require a Tcl interpreter to
be associated with.
  Do you think this is a reasonable and feasible approach?  I'd be
glad to help out with coding / testing if you think this would work.


  -Fred

--
Fred L. Drake, Jr.
fdrake@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive
Reston, VA    20191-5434

_______________
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________