Dev Prakash Sharma has Published 556 Articles

Creating a transparent background in a Tkinter window

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:51:56

7K+ Views

Tkinter window provides many inbuilt functions and properties to help an application work seamlessly. They configure the GUI of the application as well.If we want to create a transparent window in an application, then we should have to define the color in the attributes('-transparentcolor', 'color' ) method. By providing the ... Read More

Running multiple commands when a button is pressed in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:51:29

5K+ Views

The Button widget provides a way to communicate through all the existing functionalities of an application. We can perform a certain action with the help of a Button that encapsulates the function and the objects. However, there might be cases when we want to perform multiple operations with a single ... Read More

How to delete all children's elements using Python's Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:51:00

2K+ Views

Frames are very useful in a Tkinter application. If we define a Frame in an application, it means we have the privilege to add a group of widgets inside it. However, all these widgets are called Children of that particular Frame.Let us suppose that we want to remove all the ... Read More

How to get the coordinates of an object in a Tkinter canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:50:31

7K+ Views

Tkinter Canvas Widget provides GUI features to an application. It can be used to draw shapes, animate objects, and configure the existing items in a canvas. Whenever we create shapes, we have to provide the size and coordinates of the shapes in the Canvas item constructor. In order to return ... Read More

How to change the color of a Tkinter rectangle on clicking?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:49:39

6K+ Views

The Canvas widget is one of the most versatile widgets in the Tkinter Library. It is used for creating shapes of different types and sizes, animating objects, visualizing graphics, and many more. To change the property of a particular item in Tkinter, we can use itemconfig(**options) method. It takes options ... Read More

How to erase everything from a Tkinter text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:49:19

840 Views

Tkinter Text widget is more than just a multiline Entry widget. It supports the implementation of multicolored text, hyperlink text, and many more.Let us suppose a text widget has been created in an application. Now, to clear the Text widget, we can use the delete("1.0", END) method. It can be ... Read More

How to create transparent widgets using Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:48:57

19K+ Views

A Tkinter widget in an application can be provided with Transparent background. The background property of any widget is controlled by the widget itself.However, to provide a transparent background to a particular widget, we have to use wm_attributes('transparentcolor', 'colorname') method. It works in the widget only after adding the same transparent ... Read More

How to get the input from a Checkbox in Python Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:21:28

12K+ Views

A checkbox widget is an input widget that has two values, either True or False. A checkbox is useful in many applications where a particular value needs to be validated.Let us suppose that we want to get the Input value from a checkbox such that if it is selected, then ... Read More

Changing the Default Font for all the widgets in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:21:07

2K+ Views

Let us consider a case where we want to change the default font of a Tkinter application. To apply the font and setting it as the default font for a particular application, we have to use option_add(**options) method where we specify a property such as background color, font, etc. The ... Read More

How to create a Popup Menu in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:20:40

4K+ Views

We need menubars in applications where user interaction is required. Menus can be created by initializing the Menu(parent) object along with the menu items. A popup Menu can be created by initializing tk_popup(x_root, y_root, False) which ensures that the menu is visible on the screen. Now, we will add an event which ... Read More

Advertisements