dislin interfaced with tkinter

Christopher T King squirrel at WPI.EDU
Tue Aug 3 12:18:36 EDT 2004


On 3 Aug 2004, eesun wrote:

> I've downloaded the dislin package for the scientific plotting. And I
> have already created the application window with Tkinter (menu,
> canvas, status bar..). I want to integrate the Dislin plotting into
> the Tkinter application. For ex: show the dislin result on the Tkinter
> Canvas. Anyone can help?

I don't know anything about dislin; scanning through its web site, it 
looks like a commercial C program.  The only two ways I can think of to 
integrate something like this into a Tkinter (or any toolkit) application 
are:

1) If there's a way to pass dislin a window ID in which to draw (it 
doesn't look like it; its openwin() function uses internal IDs), you can 
create a Frame widget and pass the value returned by its .winfo_id() 
method to the library.

2) If you can find no better way, as a last resort you can have dislin 
write its output to an image file, and read the file using the Python 
Imaging Library (PIL), which is integrated very well into Tkinter (you can 
use its ImageTk class to create an image suitable for a Label, Canvas, or 
what-have-you).

If your application isn't dependant on dislin and doesn't need 3D 
graphing capabilities, consider switching to matplotlib 
(http://matplotlib.sf.net/), which provieds the embedability you want.




More information about the Python-list mailing list