programming.nbk: Home | Index | Next Page: Tk: Events | Previous Page: Tk: Dialog Boxes
Tk: entry
Some Options
-width NUMBER Width of the input field. NUMBER should be an integer.
-textvariable VARIABLE The contents of the variable VARIABLE will be displayed in the widget. If the text in the widget is edited, the variable will be edited automatically. VARIABLE should be given without a preceding '$' sign.
-state STATE The state of the input field. It can be normal, disabled, or readonly. If it is readonly the text can't be edited.
Some Commands
Syntax Description Example
path get The text inside input field can be taken by this
command set name [.ent get]
path delete FIRST ?LAST? Delete one or more elements of the entry. FIRST is the index of the first character to delete, and LAST is the index of the character just after the last one to delete. If last isn't specified it defaults to FIRST+1, i.e. a single character is deleted. This command returns an empty string. .ent delete 0 end
path insert index STRING Insert the characters of STRING just before the character indicated by index. Index is 0 for the first character. The word "end" can be used for the last character .ent insert end "Hello"
programming.nbk: Home | Index | Next Page: Tk: Events | Previous Page: Tk: Dialog Boxes
Notebook exported on Monday, 7 July 2008, 18:56:06 PM Eastern Daylight Time