Esempio n. 1
0
def main():
    
    mesa = puzzle.table()
    root = Tk()
    ex = Example(root, mesa)
    root.geometry("306x350+300+300")
    #root = Frame(root, width=600, height=600)
    root.bind("<Key>", ex.key)
    #root.bind("<Button-1>", ex.callback)
    #root.pack()
    root.mainloop()
Esempio n. 2
0
def main():
    
    root = Tk()
    root.geometry("270x100+300+300")
    app = Example(root)
    root.mainloop()
    
    print app.vector_inicial
    print app.vector_final
    
    mesa = puzzle.table()
    
    if app.vector_inicial != None:
    	if app.vector_final != None: 
    		if app.vector_inicial != app.vector_final:
    			print 'setar 2'
    			mesa.set_vector(app.vector_inicial)
    			mesa.set_target(app.vector_final)
    	else:
    		mesa.set_vector(app.vector_inicial)
    elif app.vector_final != None:
    	mesa.set_target(app.vector_final)
    	mesa.shuffle()
    #elif app.vector_inicial == None and app.vector_final == None:
    else:
    	print 'ola'
    	mesa.shuffle()
    	
    	
    root2 = Tk()
    ex = Example2(root2, mesa)
    root2.geometry("306x350+300+300")
    #root = Frame(root, width=600, height=600)
    root2.bind("<Key>", ex.key)
    #root.bind("<Button-1>", ex.callback)
    #root.pack()
    root2.mainloop()