Dev Prakash Sharma has Published 548 Articles

How do I center the text in a Tkinter Text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:33:48

20K+ Views

Tkinter text widget is a multiline text input widget. It is used to insert, delete, and add textual data in the input field. It provides many built-in functions and attributes in its widget class.To configure and align the text at the CENTER of a Tkinter Text widget, we can use ... Read More

Difference between title() and wm_title() methods in Tkinter class

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:33:29

1K+ Views

Tkinter has a definite class hierarchy which contains many functions and built-in methods. As we create applications, we use these functions to build the structure of components.The wm class stands for "window manager" that is a mixin class that provides many builtin functions and methods.The method wm_title() is used to change ... Read More

How to edit a Listbox item in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:32:36

4K+ Views

Tkinter Listbox widget is generally used to create a list of items. It can store a list of numbers, characters and support many features like selecting and editing the list items.To edit the Listbox items, we have to first select the item in a loop using listbox.curselection() function and insert a ... Read More

How to make a system tray application in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:32:06

6K+ Views

A System Tray application is created for the continuous execution of the program. Whenever an application is closed by the user, it will get its state running on the taskbar. To identify a system tray application, we can provide an image or icon to its application.To create a System Tray ... Read More

How to add Label width in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:31:27

3K+ Views

A Label widget is used to display text and images in an application. The size of the label widget depends on a number of factors such as width, height, and Font-size of the Label text. The height and width define how the label widget should appear in the window.To set ... Read More

How to set the height/width of a Label widget in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:30:02

25K+ Views

The Label widgets are used for displaying text and images in the application. The size of the label widget depends on a number of factors such as width, height, and Font-size of the Label text.The height and width define how the label widget should appear in the window. To set ... Read More

How to stop a loop with a stop button in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:29:35

8K+ Views

Consider a case of running a process in a loop and we want to stop the loop whenever a button is clicked. Generally, in programming languages, to stop a continuous while loop, we use a break statement. However, in Tkinter, in place of the while loop, we use after() to run the defined function ... Read More

Undo and redo features in a Tkinter Text widget

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:29:07

2K+ Views

Tkinter Text widget is another input widget similar to the Entry widget which accepts multiline user input in a text field. It contains many inbuilt features and functions which helps to configure the default properties of the text widget. However, to add undo/Redo features in the Tkinter text widget, we ... Read More

How to use images in Tkinter using photoimage objects?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:28:13

6K+ Views

Python supports PIL or Pillow package which is an open-source library for opening, manipulating, and saving different formats of images in Python projects. We can use it in our Tkinter application to process and display images.The Label widget in Tkinter is used to render text and images in a Tkinter ... Read More

How to set the position of a Tkinter window without setting the dimensions?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 19-Jun-2021 08:27:32

2K+ Views

Tkinter windows are executed after initializing the object of the Tkinter frame or window. We can define the size of the Tkinter window or frame using the Geometry manager. It defines the width and height of the initial Tkinter window where we generally place our widgets. To set the position ... Read More

Advertisements