Entry (Text field) with a label inside a border panel : TextField Entry « GUI Tk « Python






Entry (Text field) with a label inside a border panel

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

1.Use EntryUse Entry
2.Entry: TextField: get entered valueEntry: TextField: get entered value
3.Entry: enter eventEntry: enter event
4.Use Entry widgets directly and layout by rowsUse Entry widgets directly and layout by rows
5.Entry Fields in a rowEntry Fields in a row
6.Get value from EntryGet value from Entry
7.Set textvariable for Entry
8.Bind enter key to Entry
9.implement a very simple calculator, just evaluating Python math
10.Attached variables
11.Entry Field in a model dialogEntry Field in a model dialog