Dev Prakash Sharma has Published 548 Articles

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

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

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

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

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

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

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

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

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

Configure tkinter/ttk widgets with transparent backgrounds

Dev Prakash Sharma

Dev Prakash Sharma

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

5K+ Views

Tkinter has many feature attributes and properties to frame the structure of an application and configure the widget. In this article, we will see how to set Tkinter widgets with a transparent background. The wm_attributes('-transparentcolor', 'color') method is used for providing the transparent background to the widget.ExampleIn this example, we will ... Read More

How to remove the dashed line from the Tkinter menu UI?

Dev Prakash Sharma

Dev Prakash Sharma

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

1K+ Views

A Menu Bar contains vertically stacked menu items. We can create a Menu bar by initializing the object of Menu(root). Whenever we initialize a Menu bar in an application, it displays a line separator at the top of the Menu Bar.To remove the separator or the dashed line from the ... Read More

Advertisements