If you want to make the Text widget horizontally scrollable, then you can set this option to the set() method of Scrollbar widget The default value of this option is CHAR which breaks the line which gets too wider at any character To wrap wider lines into multiple lines this option is used. This option represents the width of the widget and this is in characters. This option is used to control how the tab character is used for the positioning of the text If the value of this option is set to DISABLED then the widget becomes unresponsive to mouse and keyboard The default value of this option is SUNKEN. This option indicates the type of the border of the widget. This option indicates the vertical padding of the widget. This option indicates the horizontal padding of the widget. This option is used to represent the color of the insertion cursor. This option indicates the color of the focus highlight when the widget is under the focus. This option is used to indicate the thickness of the highlight. This option indicates the highlightcolor at the time when the widget isn't under the focus. This option indicates the vertical dimension of the widget and it is mainly in the number of lines. This option indicates the text color of the widget This option is used to indicate the font type of the text. This option will convert the mouse pointer to the specified cursor type and it can be set to an arrow, dot, etc. If you do not want to export the text then you can set the value of this option to 0. This option is used to export the selected text in the selection of the window manager. This option indicates the background color of the widget. This option represents the border width of the widget. Tkinter Text Widget Options:įollowing are the various options used with Text widgets: Name of the option You can use many options to configure the text editor and these options are written as comma-separated key-value pairs. In the above syntax, the master parameter denotes the parent window. The syntax of the Text widget is given below: W = Text(master, options) Thus in order to show textual information, we will use the Text widget. There are some variety of applications where you need multiline text like sending messages or taking long inputs from users, or to show editable long format text content in application, etc. Media files like images and links can also be inserted in the Text Widget. You can also use marks and tabs in the Text widget to locate the specific sections of the text. You can use various styles and attributes with the Text widget. The text widget is used to provide a multiline textbox (input box) because in Tkinter single-line textbox is provided using Entry widget. If you want a text-editor in your desktop application then you can use the Tkinter Text widget. In this tutorial, we will cover the Tkinter Text widget in Python.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |