Dev Prakash Sharma has Published 556 Articles

How to attach a Scrollbar to a Text widget in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 27-Mar-2021 06:07:30

2K+ Views

Tkinter Text widget is used to accept multiline user Input. It is similar to Entry Widget but the only difference is that Text widget supports multiple line texts. In order to create a Text widget, we have to instantiate a text object.Adding multiple texts will require to add the ScrollBar. ... Read More

How to bundle a Python Tkinter application including dependencies?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:21:10

769 Views

Let us suppose we have created a tkinter application and now, we want to bundle the standalone application to make it portable and executable. We can use different Python packages that support various functionality to bundle the whole application code into an executable installer. These packages compress the code and ... Read More

How to center a window on the screen in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:18:04

18K+ Views

In order to place a tkinter window at the center of the screen, we can use the PlaceWindow method in which we can pass the toplevel window as an argument and add it into the center.We can also set the window to its center programmatically by defining its geometry.Example#Import the ... Read More

How to change a Tkinter widget's font style without knowing the widget's font family/size?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:16:41

229 Views

Tkinter’s widgets support properties and attributes such as font-family and font size which can be specified using the font(‘Font-Family’, font-size) property.ExampleIn the following example, we have created a text label that can be configured by defining the font-family as “Times New Roman” and the font-size as “20”.#Import the tkinter library ... Read More

How to change the color of certain words in a Tkinter text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:16:15

10K+ Views

Tkinter text widgets are used to create and display multiline text Input. It provides several functions and methods that are generally used to configure a text widget.Let us suppose we want to change the color of certain words in a text widget, then we can use the tag_add(tag name, range) ... Read More

How to change Tkinter Button state from disabled to normal?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:15:51

834 Views

Tkinter provides Button widgets to create a button for triggering an event. Let us suppose we have created a button that is already disabled in an application. In order to change the state of the button, we can use the state property.The state property is used to enable and disable ... Read More

How to clear an entire Treeview with Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:11:06

4K+ Views

Tkinter Treeview widgets are used to display the hierarchy of the items in the form of a list. It generally looks like the file explorer in Windows or Mac OS.Let us suppose we have created a list of items using treeview widget and we want to clear the entire treeview, ... Read More

How to clear out a frame in the Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:09:19

21K+ Views

Tkinter frames are used to group and organize too many widgets in an aesthetic way. A frame component can contain Button widgets, Entry Widgets, Labels, ScrollBars, and other widgets.If we want to clear the frame content or delete all the widgets inside the frame, we can use the destroy() method. ... Read More

How to clear the contents of a Tkinter Text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:08:12

19K+ Views

Tkinter Text Widget is used to add the text writer in an application. It has many attributes and properties which are used to extend the functionality of a text editor. In order to delete the input content, we can use the delete("start", "end") method.Example#Import the tkinter library from tkinter import ... Read More

How to clear Tkinter Canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:05:41

20K+ Views

Tkinter provides a way to add a canvas in a window and when we create a canvas, it wraps up some storage inside the memory. While creating a canvas in tkinter, it will effectively eat some memory which needs to be cleared or deleted.In order to clear a canvas, we ... Read More

Advertisements