id like to align 2 squares and 2 circles on each row currently occupied by the start button and label but cannot get anything to successfully work alongside what I already have
Code: Select all
from Tkinter import *
class Grid(Frame):
def var1(self):
self.label4String.set("Panel Test Began")
if self.button1["text"] == "Begin Panel Test":
self.label4.config(bg='green', fg='black')
self.after(2)
print "You have started the panel test:", self.label4String.get()
self.button1["text"] = "Stop Panel Test"
else:
self.button1["text"] = "Begin Panel Test"
self.label4.config(bg='dark red', fg='white')
self.after(2)
self.label4String.set("Panel Test Ended")
print "You have stopped the panel test:", self.label4String.get()
def __init__(self):
Frame.__init__(self)
self.master.title( "Grid")
self.variable = "Start Variable"
self.master.rowconfigure(0, weight=1)
self.master.columnconfigure(0, weight=1)
self.grid(sticky=W+E+N+S)
self.button1 = Button(self, text = "Begin Panel Test", command=self.var1)
self.button1.grid(row=1, column=1, sticky=W+E+N+S)
self.button2 = Button(self, text="Quit", command=exit)
self.button2.grid(row=1, column=2, sticky=W+E+N+S)
self.label4String = StringVar()
self.label4 = Label(self, textvariable=self.label4String)
self.label4.grid(row=2, column=1, columnspan=2, sticky=W+E+N+S)
self.rowconfigure(1, weight=1)
self.columnconfigure(1, weight=1)
def main():
Grid().mainloop()
if __name__ == '__main__':
main()