Dev Prakash Sharma has Published 548 Articles

Removing minimize/maximize buttons in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

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

5K+ 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

5K+ 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

3K+ 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

6K+ 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

12K+ 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

8K+ 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

368 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

How to interactively validate an Entry widget content in tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

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

2K+ Views

Validating the content is a necessary part of any featured application where we allow only the required data to be processed. An Entry Widget in tkinter is used to display single line text Input. However, we can validate the Entry widget to accept only digits or alphabets.Let us first create ... Read More

How to highlight text in a tkinter Text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Apr-2021 06:50:53

6K+ Views

Tkinter Text widget is used to create text fields that accept multiline user inputs. Let us suppose that in a text widget, we want to highlight some text. In order to highlight a specific text written in the text widget, tkinter provides the tag_add(tag, i, j) method. It adds tags to ... Read More

Advertisements