Dev Prakash Sharma has Published 548 Articles

How to resize the background image to window size in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-May-2021 11:51:31

7K+ Views

In order to work with images, Python Library provides Pillow or PIL package that enables applications to import images and perform various operations on them.Let us suppose that we want to resize an image dynamically to its window. In such case, we have to follow these steps −Open the Image ... Read More

How to change the thickness of a shape's outline on a Tkinter canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-May-2021 11:50:27

5K+ Views

Let us suppose we have created an oval on a Tkinter canvas. The task is to change the thickness of the oval's outline. To change the thickness of the outline, provide a border or outline to a rectangle, define the width property in the constructor and assign it an integer value. ... Read More

How to colorize the outline of a canvas rectangle in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-May-2021 11:49:36

3K+ Views

Let us suppose we have created a rectangle on a Tkinter canvas. The task is to provide the rectangle with an outline that can have a color in it. To provide a border or outline to a rectangle, first define the outline property in the constructor and add a new ... Read More

How do you create a Button on a Tkinter Canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:53:44

5K+ Views

Canvas widget is one of the versatile widgets in the Tkinter library. You can use canvas to draw different shapes, arcs, and objects to animate within the canvas. To create a button on a Tkinter Canvas, simply pass the parent as the canvas in place of a parent in the ... Read More

Attach scrollbar to listbox as opposed to window in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

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

3K+ Views

A Listbox widget contains a list of items such as a list of numbers or characters. Let us suppose that you want to create a long list of items using the Listbox widget. Then, there should be a proper way to view all the items in the list. Adding Scrollbar ... Read More

Changing the appearance of a Scrollbar in Tkinter (using ttk styles)

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 09:52:59

5K+ Views

Scrollbars are used to wrap an amount of text or characters in a frame or window. It provides a text widget to contain as many characters as the user wants.The Scrollbar can be of two types: Horizontal Scrollbar and Vertical Scrollbar.The length of a scrollbar changes whenever the number of ... Read More

How to see if a widget exists in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

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

4K+ Views

To make a particular Tkinter application fully functional and operational, we can use as many widgets as we want. If we want to check if a widget exists or not, then we can use the winfo_exists() method. The method can be invoked with the particular widget we want to check. ... Read More

Determine which Button was pressed in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

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

6K+ Views

Buttons are very useful in many applications where user interaction is required. Let us suppose that we want to know which button is pressed in a given application. In order to get the information about the Button, we can use the callback function in the Button configuration. In the Callback ... Read More

Creating a transparent background in a Tkinter window

Dev Prakash Sharma

Dev Prakash Sharma

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

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

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

Advertisements