Dev Prakash Sharma has Published 556 Articles

Select all text in a Text widget using Python 3 with tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 07:16:35

2K+ Views

Tkinter text widgets are used for creating text fields that contain multiline user input. It has many inbuilt functions and methods which can be invoked to perform certain operations on text widgets. In contrast, let us assume that we have written a bunch of context in the text widget and ... Read More

Resizing pictures in PIL in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 07:14:47

579 Views

Python provides Pillow or PIL package for image processing which is used to load, process, and customize the images in an application. It has many properties like Color of the image, Image Font, resizing the images, loading the image, etc.In order to resize the Images in an application, we can ... Read More

Removing minimize/maximize buttons in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 07:11:30

4K+ Views

When we run our tkinter application, it initially displays a window that has an interface to display all the widgets. Eventually, we can remove the maximizing and minimizing property of the displayed window by using the resizable(boolean) method. It takes two Boolean values that refer to the status of width ... Read More

Notebook widget in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 07:10:10

3K+ Views

Notebook widget is an inbuilt widget of ttk library in tkinter. It enables the user to create Tabs in the window application. Tabs are generally used to separate the workspace and specialize the group of operations in applications at the same time.ExampleIn this example, we will create two tabs using ... Read More

How to use an image for the background in tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 07:06:46

2K+ Views

Background images in tkinter are versatile as the functionality can be used in making 3D, 2D games, screensaver, desktop visualizations software, etc. Tkinter canvas is used to work with all these functionalities in an application.ExampleIn this example, we will add a background image using the create_image() method in the canvas widget.#Import ... Read More

How to use a custom font in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 07:05:03

2K+ Views

To define and display a custom font in Python tkinter, we generally use an inbuilt font library defined in tkinter. In order to import the tkinter Font library in the notebook, type the following in the shell, from tkinter.font import FontNow, create an Object of Font using the Font(..options) function ... Read More

How to update the image of a Tkinter Label widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 07:03:16

5K+ Views

We have used Label widget to group all the widgets in the application. A Label widget takes text and images in the constructor that sets the label with the position in the top-left corner of the window. However, to change or update the image associated with the Label, we can ... Read More

How to update an image in a Tkinter Canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 07:00:49

10K+ Views

Canvas can be used to play with images, animating objects, 3D modeling, displaying text, and many more. Moreover, we can display an image file using the create_image() constructor.Following this, let us build an application that can update the canvas images locally. We can add a button to trigger the event ... Read More

How to set focus on Entry widget in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 06:58:25

6K+ Views

Let us suppose that there are some widgets present in an application such that we have to focus on a particular widget. By using the focus_set() method, we can activate the focus on any widget and give them priority while executing the application.Example#Import tkinter library from tkinter import * ... Read More

How to position Tkinter widgets so that they are not stuck together?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 06:54:51

281 Views

In a tkinter GUI skeleton, we can add any number of widgets to make it more functional and operational. However, sometimes, it seems difficult to resize and position the widgets so that they don’t stick together and are non-variable in size. We can add padding using the widget pack manager ... Read More

Advertisements