Python Devlopment






Entry



It is used to input the single line text entry from the user.. For multi-line text input, Text widget is used.
The general syntax is:

textbox=Entry(win, option=value)

win is the parameter used to represent the parent window.
There are number of options which are used to change the format of the widget. Number of options can be passed as parameters separated by commas. Some of them are listed below.

  • bd: to set the border width in pixels.
  • bg: to set the normal background color.
  • cursor: to set the cursor used.
  • command: to call a function.
  • highlightcolor: to set the color shown in the focus highlight.
  • width: to set the width of the button.
  • height: to set the height of the button.
Example:
from Tkinter import *
win=Tk()
win.title('My Textbox')
win.geometry('350x250')
textbox=Entry(win)
textbox.pack()
win.mainloop()