Dev Prakash Sharma has Published 556 Articles

How do I use Window Manager (wm) attributes in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:13:10

4K+ Views

The Window Manager is a toolkit available in Tcl/Tk that can be accessed with the command 'wm'. The 'wm' command allows you to set the appearance and geometry of the Tkinter window. We can control the title, color, size, and other attributes with this command. The 'wm' command has numerous ... Read More

Passing arguments to a Tkinter button command

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:11:57

5K+ Views

The Button widget in Tkinter is generally used for pushing an event defined in an application. We can bind the events with buttons that allow them to execute and run whenever an action is triggered by the user.However, sharing the data and variables outside the function and events seems difficult ... Read More

How to get a Popup Dialog in Tkinter/Python?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:10:23

3K+ Views

Tkinter is a standard Python library that is used to create and develop GUI-based applications. We can create an application in Tkinter and add widgets to it that make the application more interactive.Let's suppose we want to show a popup dialog in an application. In this case, we can use ... Read More

How do I use PIL with Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:06:51

3K+ Views

The PIL or Pillow package in Python provides a way to process images in a program. We can open an image, manipulate the image for different use, and can use it to visualize the data as well. In order to use the PIL package in Tkinter, you've to install the ... Read More

How to add a separator in Menu item in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:04:36

2K+ Views

The Tkinter Menu widget is used to create a dropdown menu in an application. With menu widgets, we can select an item from the menu and run a specific task in the application.In many applications, we see a dotted separator line that separates the menu items in the menu. The ... Read More

How to draw a dot on a canvas on a click event in Tkinter Python?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:02:52

3K+ Views

Consider a case for creating a GUI application such that when we click on the window with a mouse button, it stores the coordinates and draws a dot. Tkinter provides events that allow the user to bind the keys or buttons with the functions.To draw a dot on click event, ... Read More

Using a Frame class in a Tk class in Python tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 13:59:25

2K+ Views

Tkinter Frame widget is very useful for grouping multiple widgets in a frame. It includes all the functions and properties that applies to the parent window.To create a Frame widget, we can instantiate an object of the Frame class. Once we define the Frame widget in the window, we can ... Read More

How to bind the Enter key to a tkinter window?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 13:57:57

18K+ Views

Tkinter events are executed at runtime and when we bind these events with a button or key, then we will get access to prioritize the event in the application.To bind the key with an event in Tkinter window, we can use bind('', callback) by specifying the key and the ... Read More

How to draw a png image on a Python tkinter canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 13:56:10

3K+ Views

To work with images in tkinter, Python provides PIL or Pillow toolkit. It has many built-in functions that can be used to operate an image of different formats.To open an image in a canvas widget, we have use create_image(x, y, image, **options) constructor. When we pass the Image value to ... Read More

How to set the font size of Entry widget in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 13:54:30

4K+ Views

The Entry widget in tkinter is a basic one-line character Entry box that accepts single line user input. To configure the properties of the Entry widget such as its font-size and width, we can define an inline widget constructor.ExampleHere is an example of how you can define the font-size of ... Read More

Advertisements