
Sets the ANCHOR index position to the character selected by index, and selects that character. If there isn't currently a selection, has no effect. This method is used to make sure that the selection includes the character at the specified index.Ĭlears the selection.

Inserts string s before the character at the given index. Has no effect if the text fits entirely within the entry. Shift the contents of the entry so that the character at the given index is the leftmost visible character. Set the insertion cursor just before the character at the given index. Returns the entry's current text as a string.

If the second argument is omitted, only the single character at position first is deleted. If you expect that users will often enter more text than the onscreen size of the widget, you can link your entry widget to a scrollbar.įollowing are commonly used methods for this widget − Sr.No.ĭeletes characters from the widget, starting with the one at index first, up to but not including the character at position last. You can set this option to a number of characters and the checkbutton will always have room for that many characters. The default width of a checkbutton is determined by the size of the displayed image or text. In order to be able to retrieve the current text from your entry widget, you must set this option to an instance of the StringVar class. If the cursor is currently over the checkbutton, the state is ACTIVE. The default is state = NORMAL, but you can use state = DISABLED to gray out the control and make it unresponsive. entry that echoes each character as an asterisk, set show = "*". Normally, the characters that the user types appear in the entry. The foreground (text) color of selected text. The width of the border to use around selected text. The background color to use displaying selected text. You may set this option to any of the other styles With the default value, relief = FLAT, the checkbutton does not stand out from its background. If the text contains multiple lines, this option controls how the text is justified: CENTER, LEFT, or RIGHT. The color of the focus highlight when the checkbutton has the focus. To avoid this exportation, use exportselection = 0. If you set this option to a cursor name ( arrow, dot etc.), the mouse cursor will change to that pattern when it is over the checkbutton.īy default, if you select text within an Entry widget, it is automatically exported to the clipboard. Default is 2 pixels.Ī procedure to be called every time the user changes the state of this checkbutton. The size of the border around the indicator.

The normal background color displayed behind the label and indicator. These options can be used as key-value pairs separated by commas. Options − Here is the list of most commonly used options for this widget. Master − This represents the parent window. Here is the simple syntax to create this widget − If you want to display one or more lines of text that cannot be modified by the user, then you should use the Label widget. If you want to display multiple lines of text that can be edited, then you should use the Text widget. The Entry widget is used to accept single-line text strings from a user.
