Dev Prakash Sharma has Published 548 Articles

How to create a multiline entry with Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:57:43

2K+ Views

Let us suppose that we want to create an Entry widget that supports multiline user input. In order to create a multiline Entry widget, we can use Text() constructor.ExampleHere, in this example, we will create a window that contains a multiline Entry widget.#Import the library from tkinter import * ... Read More

How to create a password entry field using Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:57:10

7K+ Views

Let us suppose we want to add an Entry widget which accepts user passwords. Generally, the passwords are displayed using “*” which yields to make the user credentials in an encrypted form.We can create a password field using tkinter Entry widget.ExampleIn this example, we have created an application window that ... Read More

How to delete Tkinter widgets from a window?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:54:36

8K+ Views

Sometimes, we want to remove a widget that is of no use in the application. We can delete widgets from the window or frame using the .destroy method in tkinter. It can be invoked in the widget by defining a function for it.ExampleIn this example, we have created a button ... Read More

How to display full-screen mode on Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:51:08

15K+ Views

Tkinter displays the application window by its default size. However, we can display a full-screen window by using attributes('fullscreen', True) method. The method is generally used for assigning a tkinter window with properties like transparentcolor,  alpha, disabled, fullscreen, toolwindow, and topmost.Example#Import the tkinter library from tkinter import * #Create ... Read More

How to get the screen size in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:48:33

21K+ Views

Tkinter initially creates a window or frame object where all the widgets, frame are displayed.Tkinter components adjust the window size and width according to user-defined geometry.In order to get the screen size, we can use winfo_screenwidth() which returns the screen width and winfo_screenheight() for the height of the screen in ... Read More

How to get the Tkinter Label text?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:48:08

2K+ Views

Tkinter Labels are used to create and display text or images on the window. It has several components and functions that can be used to customize the label information such as fontfamily, padding, width, height, etc. In order to get the Label text on the window, we can write the ... Read More

How to install Tkinter for Python on Linux?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:46:32

19K+ Views

Tkinter is one of the widely used libraries for creating GUI-based applications. In order to create applications using Tkinter, we have to install and import the library in the notebook.First, we have to install the tkinter library in our local environment based on the Windows or Linux operating system.For Windows ... Read More

How to make a Tkinter widget invisible?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:42:38

5K+ Views

To make a tkinter widget invisible, we can use the pack_forget() method. It is generally used to unmap the widgets from the window.ExampleIn the following example, we will create a label text and a button that can be used to trigger the invisible event on the label text widget.#Import the ... Read More

How to make a Tkinter window jump to the front?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:40:50

3K+ Views

In order to make the tkinter window or the root window jump above all the other windows, we can use attributes method that will generally take two values specifying the “topmost” value and the other is a Boolean value.Example#Importing the library from tkinter import * #Create an instance of ... Read More

How to make a Tkinter window not resizable?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:39:51

10K+ Views

Tkinter initially creates a resizable window for every application. Let us suppose that we want to make a non-resizable window in an application. In this case, we can use resizable(height, width) and pass the value of height=None and width=None. The method also works by passing Boolean values as resizable(False, False).Example#Import the required libraries ... Read More

Advertisements