Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # posicionamiento grid
- import tkinter as tk
- from tkinter import ttk
- ventana = tk.Tk()
- ventana.title("Posicionamiento grid")
- ventana.config(bg="Light Steel Blue")
- # expansión horizontal columna 1
- ventana.columnconfigure(1, weight=1)
- # expansion vertical fila 1
- ventana.rowconfigure(1, weight=1)
- entry = ttk.Entry()
- entry.grid(row=0, column=0)
- boton = ttk.Button(text="Hola")
- # anclaje (sticky) n,s, w,e y espaciado
- boton.grid(row=1, column=1, sticky="nsew", padx= 100, pady=50)
- entry = ttk.Entry()
- entry.grid(row=2, column=2)
- ventana.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement