frame_grid.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from tkinter import *
from tkinter import messagebox
###########################
def senden():
messagebox.showinfo('Senden','May be later!')
def verbinde():
messagebox.showinfo('Verbinde','May be later!')
def info():
messagebox.showinfo('Info','Pack-und Grid-Demo (mit Frames)!')
def ende():
root.destroy()
###########################
root = Tk()
root.title('Pack-und Grid-Demo (mit Frames!)')
foben = Frame(root,width=500)
foben.pack(expand=YES, fill=BOTH)
textfenster = Text(foben,width=90)
textfenster.pack(fill=BOTH,expand=YES)
funten = Frame(root,width=500)
funten.pack(side=BOTTOM,expand=YES, fill=BOTH)
eingabe = Entry(funten,width=60)
eingabe.grid(row=1,column=0)
but1 = Button(funten,text='Senden', command = senden)
but1.grid(row=1,column=1)
but2 = Button(funten,text='Verbinden', command = verbinde)
but2.grid(row=1,column=2)
but3 = Button(funten,text='Info', command = info)
but3.grid(row=1,column=3)
but4 = Button(funten,text='Beenden', command = ende)
but4.grid(row=1,column=4)
root.mainloop()
→ Fenster schließen