[PYTHON MATRIX-SIG] Gist plots with Tk?

Alex Cannon acannon@geog.ubc.ca
Thu, 1 Aug 1996 14:36:05 -0700 (PDT)

This may seem off-topic, but I couldn't decide whether this should go in
matrix-sig (because of the gist tie in) or the GUI list (because of 

Anyhow, is it possible to get Tk and the gist module to coexist? As an
example, I've modified the simple 'hello world' tkinter script to plot a line
with gist. Running the script and clicking on the 'Plot' button causes the
gist window to popup, but the plot doesn't finish until after quitting the Tk
mainloop() (when running with -i). 

Is there a way to do this properly? 



from Tkinter import *
from gist import *

class Test(Frame):
    def plot(self):
	plg([0, 1])

    def createWidgets(self):
	self.QUIT = Button(self, {'text': 'Quit', 
				  'fg': 'red', 
				  'command': self.quit})
	self.QUIT.pack({'side': 'left', 'fill': 'both'})

	self.gist_test = Button(self, {'text': 'Plot', 
				      'command': self.plot})
	self.gist_test.pack({'side': 'left'})

    def __init__(self, master=None):
	Frame.__init__(self, master)

test = Test()

Alex Cannon  (acannon@geog.ubc.ca)       Geography 240C
Atmospheric Science Programme            Tel: (604) 822-2269
University of British Columbia, B.C.     Fax: (604) 822-6150

MATRIX-SIG  - SIG on Matrix Math for Python

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