Subject: Re: [nmr_sparky] save postscripts in a loop
From: Tom Goddard
Date: Jun 13, 2008

Previous: 513

Hi Krzysztof,

Sparky spectrum view windows do not use a Tk Canvas. They draw
directly into a Tk Frame. So the canvas.postscript() call will not help
you capture an image. The only possibility for capturing an image is to
do some kind of screen capture. This could be done with PIL if you
installed it with the Sparky Python.

http://mail.python.org/pipermail/image-sig/2003-May/002292.html

The Tk name of the frame is v.frame + .drawing where v is the Python
spectrum View object. There is no built-in way in Tk to do the image
capture as far as I know. There is also no Python interface to Sparkys
File / Print.... That code is only accessible from C++.

Tom



Krzysztof wrote:

Hello everyone!

I am going to write a simple python script which:
1 .Opens sequence of 2D spectra
2. Sets given contour scale in each spectrum
3. Saves each spectrum (view) to postscript file

Point 1 and point 2 Ive already done (basing on openspectra.

py). But
how to perform point 3? I think that I should use
canvas.postscript(file=path) function but I dont know how to obtain
canvas of each from the sequence of opened windows.

Thanks in advance for the answer!

Krzysztof