Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Tkinter import *
- import tkMessageBox
- #def clicAndClose(event)
- class app(object):
- def __init__(self, parent):
- self.availableCodes = [1,2, 3, 4, 5]
- top = self.top = Toplevel(parent)
- self.label1 = Label(top, text = "Ingrese su contrasena")
- self.label1.pack()
- self.entry1 = Entry(top)
- self.entry1.pack()
- self.button1 = Button(top, text = "Ingrese", command = self.ok)
- self.button1.pack(pady= 5)
- self.button1val = 0
- self.button2val = 0
- self.button3val = 0
- self.button4val = 0
- self.button5val = 0
- self.button6val = 0
- self.button7val = 0
- self.button8val = 0
- self.button9val = 0
- self.button10val = 0
- self.button11val = 0
- self.button12val = 0
- def ok(self):
- self.code = int(self.entry1.get())
- self.voteWindow(self.code, self.availableCodes)
- self.top.destroy()
- def voteWindow(self, code, listOfCodes):
- if code in listOfCodes:
- print "True"
- self.optionsWindows()
- listOfCodes.remove(code)
- else:
- print "False"
- def optionsWindows(self):
- top = self.top = Toplevel(self.top)
- topframe = Frame(top)
- self.button1 = Button(topFrame, text = "Proyecto 1", command = self.close(self.button1val))#( self.button1val))
- self.button1.pack(side = LEFT)
- self.button2 = Button(topFrame, text = "Proyecto 2", command = self.close(self.button2val))#(options, self.button2val))
- self.button2.pack(side = LEFT)
- self.button3 = Button(topFrame, text = "Proyecto 3", command = self.close(self.button3val))#(options, self.button3val))
- self.button3.pack(side = LEFT)
- self.button4 = Button(topFrame, text = "Proyecto 4", command = self.close(self.button4val))#(options, self.button4val))
- self.button4.pack(side = LEFT)
- self.button5 = Button(topFrame, text = "Proyecto 5", command = self.close(self.button5val))#(options, self.button5val))
- self.button5.pack(side = LEFT)
- self.button6 = Button(topFrame, text = "Proyecto 6", command = self.close(self.button6val))#(options, self.button6val))
- self.button6.pack(side = LEFT)
- self.button7 = Button(topFrame, text = "Proyecto 7", command = self.close(self.button7val))#(options, self.button7val))
- self.button7.pack(side = LEFT)
- self.button8 = Button(topFrame, text = "Proyecto 8", command = self.close(self.button8val))#(options, self.button8val))
- self.button8.pack(side = LEFT)
- self.button9 = Button(topFrame, text = "Proyecto 9", command = self.close(self.button9val))#(options, self.button9val))
- self.button9.pack(side = LEFT)
- self.button10 = Button(topFrame, text = "Proyecto 10", command = self.close(self.button10val))#(options, self.button10val))
- self.button10.pack(side = LEFT)
- self.button11 = Button(topFrame, text = "Proyecto 11", command = self.close(self.button11val))#(options, self.button11val))
- self.button11.pack(side = LEFT)
- self.button12 = Button(topFrame, text = "Proyecto 12", command = self.close(self.button12val))#(options, self.button12val))
- self.button12.pack(side = LEFT)
- def close(self, variable):
- variable +=1
- self.top.destroy()
- def onClick():
- run = app(root)
- root.wait_window(run.top)
- root = Tk()
- root.configure(bg = "white")
- topFrame = Frame(root, bg = "white")
- topFrame.pack()
- bottomFrame = Frame(root, bg = "white")
- bottomFrame.pack()
- label1 = Label(topFrame, text = 'Unidad Educativa Julio Verne', font=("Times",22), fg = 'forest green', bg = "white")
- label1.grid(row=0, column=0)
- label2 = Label(topFrame, text = 'Sistema de Voto Electronico', font=("Times",20), fg = 'light sea green', bg = "white")
- label2.grid(row=1, column=0)
- label3 = Label(topFrame, text = '2014-2015', font=("Times",22), fg = 'dark slate gray', bg = "white")
- label3.grid(row=2, column=0)
- label4 = Label(bottomFrame, text = 'Proyecto 1', font=("Georgia",12), bg = "white")
- label4.grid(row=0, column=0)
- label5 = Label(bottomFrame, text = 'Proyecto 2', font=("Georgia",12), bg = "white")
- label5.grid(row=1, column=0)
- label6 = Label(bottomFrame, text = 'Proyecto 3', font=("Georgia",12), bg = "white")
- label6.grid(row=2, column=0)
- label7 = Label(bottomFrame, text = 'Proyecto 4', font=("Georgia",12), bg = "white")
- label7.grid(row=3, column=0)
- label8 = Label(bottomFrame, text = 'Proyecto 5', font=("Georgia",12), bg = "white")
- label8.grid(row=4, column=0)
- label9 = Label(bottomFrame, text = 'Proyecto 6', font=("Georgia",12), bg = "white")
- label9.grid(row=5, column=0)
- label10 = Label(bottomFrame, text = 'Proyecto 7', font=("Georgia",12), bg = "white")
- label10.grid(row=6, column=0)
- label11 = Label(bottomFrame, text = 'Proyecto 8', font=("Georgia",12), bg = "white")
- label11.grid(row=7, column=0)
- label12 = Label(bottomFrame, text = 'Proyecto 9', font=("Georgia",12), bg = "white")
- label12.grid(row=8, column=0)
- label13 = Label(bottomFrame, text = 'Proyecto 10', font=("Georgia",12), bg = "white")
- label13.grid(row=9, column=0)
- label14 = Label(bottomFrame, text = 'Proyecto 11', font=("Georgia",12), bg = "white")
- label14.grid(row=10, column=0)
- label15 = Label(bottomFrame, text = 'Proyecto 12', font=("Georgia",12), bg = "white")
- label15.grid(row=11, column=0)
- mainButton = Button(root, text='Click aqui para votar', command=onClick)
- mainButton.pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement