Entry (Text field) with a label inside a border panel
from Tkinter import *
class AllTkinterWidgets:
def __init__(self, master):
frame = Frame(master, width=500, height=400, bd=1)
frame.pack()
iframe2 = Frame(frame, bd=2, relief=RIDGE)
Label(iframe2, text='Label:').pack(side=LEFT, padx=5)
t = StringVar()
Entry(iframe2, textvariable=t, bg='white').pack(side=RIGHT, padx=5)
t.set('Entry widget')
iframe2.pack(expand=1, fill=X, pady=10, padx=5)
root = Tk()
all = AllTkinterWidgets(root)
root.title('Tkinter Widgets')
root.mainloop()
Related examples in the same category