Dev Prakash Sharma has Published 556 Articles

How to create a borderless fullscreen application using Python-3 Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:12:56

2K+ Views

In order to make a Tkinter window borderless and full-screen, we can use the utility method attributes(‘-fullscreen’, True). Tkinter windows can be configured using functions and methods defined in the Tkinter library.Another similar method Tkinter provides to make the application window full-screen is, overrideredirect(True). This method can be invoked only ... Read More

How can I create a dropdown menu from a List in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 06:09:57

13K+ Views

Let us suppose we want to create a dropdown menu of a list in an application using tkinter. In this case, we can use the Tkinter OptionMenu(win, menu_to_set, options) function.First, we will instantiate an object of StringVar(), then we will set the initial value of the dropdown menu. We will ... Read More

How to add an image in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 21-Apr-2021 07:46:07

3K+ Views

Images are very useful objects in any application. We can process Images in a Tkinter application using the Pillow or PIL package in Python. There are several built-in functions such as loading an image, extracting an image, configuring the image pane, etc.ExampleIn this example, we will add by asking the ... Read More

How do you check if a widget has a focus in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 21-Apr-2021 07:45:47

2K+ Views

Let us assume that we want to check if a particular widget has a focused set or not. The only way to check the widget focus is to use the utility method focus_get(). It returns the object containing the widget’s information which is currently focused on, during the program’s execution. ... Read More

How do I get an event callback when a Tkinter Entry widget is modified?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 21-Apr-2021 07:45:29

6K+ Views

Callback functions in Tkinter are generally used to handle a specific event happening in a widget. We can add an event callback function to the Entry widget whenever it gets modified. We will create an event callback function by specifying the variable that stores the user input. By using the ... Read More

How to change the font on ttk.Entry in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 21-Apr-2021 07:44:11

2K+ Views

There are times when a user wants to insert the information like Name, contact number, Email, address, etc. Tkinter has a simple way to handle these types of inputs through its Entry widgets. Tkinter Entry widgets can be styled using the ttk package.To change other properties of the Entry widgets ... Read More

How can I resize the root window in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 21-Apr-2021 07:43:48

3K+ Views

In this example, we will see how to resize a tkinter window using the geometry manager. Tkinter geometry manager is generally used to configure the width and height of a tkinter window.The geometry(width, height)method takes width and height as instances and resizes the window accordingly. We can also define the ... Read More

Get the text of a button widget in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 21-Apr-2021 07:43:05

10K+ Views

Let us suppose that for a particular application, we want to retrieve the button value by its name. In such cases, we can use the .cget() function. Every tkinter widget supports the .cget() function, as it can be used to retrieve the widget configuration such as value or name.ExampleIn this ... Read More

Get Application Version using Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 21-Apr-2021 07:42:48

2K+ Views

In software industries, whenever developers add a new feature, fix bugs in a particular application, they name the application to a new version, as it helps to recognize the recently updated features in that application.Using Python, we can get the version of any application. We will use pywin32 to interact ... Read More

Disable Exit (or [ X ]) in Tkinter Window

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 21-Apr-2021 07:41:25

7K+ Views

The window manager implements the Tkinter window control icons. To hide and show the Tkinter window control icons, we can use the built-in function, which describes whether we want to disable control icons’ functionality.To disable the Exit or [X] control icon, we have to define the protocol() method. We can ... Read More

Advertisements