Advertisement
teslariu

met pack

Apr 24th, 2021
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. """
  5. Posicionamiento PACK
  6. """
  7. import tkinter as tk
  8. from tkinter import ttk
  9.  
  10. ventana = tk.Tk()
  11. ventana.title("Posicionamiento PACK")
  12. ventana.config(width=400, height=300)
  13.  
  14. caja = ttk.Entry()
  15. caja.pack()
  16.  
  17. boton = ttk.Button(text="Boton 1")
  18. boton.pack()
  19.  
  20. etiqueta = ttk.Label(text="... metodo pack")
  21. etiqueta.pack()
  22.  
  23. # caja a la izquierda
  24. caja = ttk.Entry()
  25. caja.pack(side=tk.LEFT, padx=25, pady=45, expand= True, fill=tk.BOTH)
  26.  
  27. # otra caja
  28. caja = ttk.Entry()
  29. caja.pack(side=tk.LEFT, padx=25, pady=45, expand= True, fill=tk.BOTH)
  30.  
  31. # caja antes del boton
  32. etiqueta = ttk.Label(text="... antes del botón")
  33. etiqueta.pack(before=boton)
  34.  
  35. boton2 = ttk.Button(text="Boton 2")
  36. boton2.pack(after=boton, padx=30, pady=20, ipadx=100, ipady=1)
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44. ventana.mainloop()
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement