#!/usr/bin/python import os, os.path import shutil import array from Tkinter import * from tkFileDialog import askopenfilename, asksaveasfilename, askdirectory import tkMessageBox import tkSimpleDialog class App(Frame): def __init__(self, parent): self.parent = parent Frame.__init__(self,self.parent) self.parent.title("Main Window") self.grid() Label(self, text="Text Box").grid(row=0, column=0, columnspan=2) self.txt = StringVar() self.entry = Entry(self, width=40, textvariable=self.txt) self.entry.grid(row=1, column=0, columnspan=2, padx=5, pady=5) self.entry.bind("", self.onPressEnter) self.button1 = Button(self, text="Does Nothing", width=20) self.button1.grid(row=3, column=0) self.button1.bind("", self.button1Click) self.button2 = Button(self, text="Does Nothing", width=20) self.button2.grid(row=4, column=0) self.button2.bind("", self.button2Click) self.button3 = Button(self, text="Does Nothing", width=20) self.button3.grid(row=2, column=0) self.button3.bind("", self.button3Click) self.button4 = Button(self, text="Press this Button", width=20) self.button4.grid(row=5, column=0) self.button4.bind("", self.button4Click) self.nf = True self.nrml = StringVar() self.radio1 = Radiobutton(self, text='Does Nothing', variable=self.nrml, value="0", command=self.selRadio1) self.radio1.grid(row=2, column=1, sticky=W, padx=5) self.nrml.set("0") self.bf = True self.btch = StringVar() self.radio2 = Radiobutton(self, text='Does Nothing', variable=self.btch, value="0", command=self.selRadio2) self.radio2.grid(row=3, column=1, sticky=W, padx=5) self.btch.set("0") self.sd = True self.r3state = NORMAL self.subs = StringVar() self.radio3 = Radiobutton(self, text="Does Nothing", variable=self.subs, value="0", command=self.selRadio3) self.radio3.grid(row=4, column=1, sticky=W, padx=5) self.subs.set("0") self.g2 = True self.g2fmt = StringVar() self.radio4 = Radiobutton(self, text="Does Nothing", variable=self.g2fmt, value="0", command=self.selRadio4) self.radio4.grid(row=5, column=1, sticky=W, padx=5) self.g2fmt.set("0") self.grid_columnconfigure(0,weight=1) self.entry.focus_set() self.selRadio2() # init batch processing state to false def selRadio1(self): if self.nf == True: self.nf = False self.nrml.set("1") else: self.nf = True self.nrml.set("0") def selRadio2(self): if self.bf == True: self.bf = False self.btch.set("1") self.radio3['state'] = DISABLED else: self.bf = True self.btch.set("0") self.radio3['state'] = NORMAL def selRadio3(self): if self.sd == True: self.sd = False self.subs.set("1") else: self.sd = True self.subs.set("0") def selRadio4(self): if self.g2 == True: self.g2 = False self.g2fmt.set("1") else: self.g2 = True self.g2fmt.set("0") def onPressEnter(self, event): self.bf = False self.btch.set("1") self.radio3['state'] = DISABLED self.button3Click(event) def button1Click(self, event): pass def button2Click(self, event): pass def button3Click(self, event): pass def button4Click(self, event): askforIR() def askforIR(): text = tkSimpleDialog.askstring("Title", "Enter Name Here") return text if __name__ == "__main__": root = Tk() app = App(root) root.mainloop()