Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. # Importando a biblioteca tkinter
  2. from tkinter import *
  3. from functools import partial
  4.  
  5. def abre(j):
  6. if (j==1):
  7. lbr['text'] = 'Clicou no Primeiro'
  8. elif(j==2):
  9. lbr['text'] = 'Clicou no Segundo'
  10.  
  11.  
  12.  
  13.  
  14. # Criando a janela principal
  15. janela = Tk()
  16. janela.geometry('600x600+150+150')
  17. janela.state('zoomed')
  18. janela.title ('DESENVOLVIMENTO DE SISTEMA COMPLETO II')
  19.  
  20. # para desabilitar botão state=DISABLED
  21.  
  22. # Gerando os botôes
  23. rotulo =('Primeiro','Segundo','Terceiro','Quarto','Quinto')
  24. k = 180
  25. j=0
  26. for i in rotulo:
  27. j += 1
  28. bt = Button(janela, command=(abre(j)), width=20, height=2, anchor='center',font=("Helvetica", 12) , text=(i),bg='#696969', fg='#FFA500')
  29. bt.place(x=k,y=2)
  30. k += 200
  31.  
  32. lbr = Label(janela,text='Teste dos botões')
  33. lbr.place(x=200,y=200)
  34.  
  35.  
  36. # Término do sistema.
  37. janela.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement