Dev Prakash Sharma has Published 548 Articles

How to erase everything from the Tkinter text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:24:53

397 Views

Tkinter Text widget accepts and supports multiline user input. We can specify other properties of the Text Widget such as the width, height, background, border-width, and other properties as well.Let us suppose that we want to erase all the content in the given Text widget; then, we can use the ... Read More

How to gray out (disable) a Tkinter Frame?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:24:18

6K+ Views

A Tkinter frame widget can contain a group of widgets. We can change the state of widgets in the frame by enabling or disabling the state of its underlying frame. To disable all the widgets inside that particular frame, we have to select all the children widgets that are lying ... Read More

How to insert an image in a Tkinter canvas item?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:23:41

29K+ Views

Tkinter canvas is the most versatile widget in the Tkinter library. It is used to create images, shapes, arcs, animating objects, and many more other works. In order to work and process the images, Python supports Pillow Package or PIL. We can add images in the canvas as the items ... Read More

How to insert text at the beginning of the text box in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:23:16

11K+ Views

There are two types of Text editors that Tkinter supports -- the Entry widget and the Text widget. Tkinter text widgets are used to create the text editor where we can edit, add or delete the text whenever we need. We can create a text widget using the Text(parent) constructor. ... Read More

How to open PIL Image in Tkinter on Canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:22:38

6K+ Views

Pillow package (or PIL) helps a lot to process and load images in Python projects. It is a free open-source library available in Python that adds support to load, process, and manipulate the images of different formats.In order to open the Image in Tkinter canvas, we have to first import ... Read More

How to set a widget's size in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:21:38

4K+ Views

Tkinter widgets are the building blocks of any Tkinter GUI application. It is one of the very useful components of the application that helps to structure the application functionality. Consider a case where we want to set the size (width and height) of any widget. Tkinter has built-in width and ... Read More

How to set focus for Tkinter widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:21:13

11K+ Views

Tkinter has many inbuilt functions or methods that can be used to extend the functionality of any widget in the application. Sometimes, we need to change or modify the focus of any widget in the application which can be achieved by using the focus_set() method.This method sets the default focus for ... Read More

How to set the min and max height or width of a Frame in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:20:50

6K+ Views

In order to manage too many widgets in the window, we can use Frame widgets in Tkinter. In order to place the widgets inside the frame widget, we have to set the relative width and height of the frame. To configure the relative height and width of the frame, we ... Read More

How to stop Tkinter Frame from shrinking to fit its contents?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:20:20

13K+ Views

The sizing property of all the widgets in the Tkinter frame is by default set to the size of the widgets themselves. The frame container shrinks or grows automatically to fit the widgets inside it. To stop allowing the frame to shrink or grow the widget, we can use propagate(boolean) ... Read More

How to Update the label of the Tkinter menubar item?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:19:52

1K+ Views

A Menubar contains a set of Menu Item in which each Menu Item is defined for different functionalities or operations. Let us suppose that we want to update the label of Menu Bar Items, then we can use entryconfigure(item_number, options..) method in a callback. To update the Menu Items in the ... Read More

Advertisements