cantera/interfaces/python/MixMaster/TransportFrame.py
Ray Speth 2528df0f75 Reorganized source tree structure
These changes make it unnecessary to copy header files around during
the build process, which tends to confuse IDEs and debuggers. The
headers which comprise Cantera's external C++ interface are now in
the 'include' directory.

All of the samples and demos are now in the 'samples' subdirectory.
2012-02-12 02:27:14 +00:00

35 lines
855 B
Python

from Tkinter import *
class TransportFrame(Frame):
def show(self, i, frame, row, col):
if self.checked[i].get():
frame.grid(row=row,column=col,sticky=N+E+S+W)
else:
frame.grid_forget()
def showcomp(self):
self.show(0, self.top.mixfr, 8, 0)
def showthermo(self):
self.show(1, self.top.thermo, 7, 0)
def __init__(self,master,top):
self.top = top
self.c = []
self.checked = []
Frame.__init__(self,master)
self.config(relief=GROOVE, bd=4)
lbl = ['multicomponent', 'mixture-averaged']
cmds = [self.showcomp, self.showthermo]
for i in range(2):
self.checked.append(IntVar())
self.checked[i].set(0)
self.c.append(Checkbutton(self,
text=lbl[i],
variable=self.checked[i],
onvalue=1,
offvalue=0,
command=cmds[i]
))
self.c[i].grid(column=i,row=0, sticky=W+N)