Dev Prakash Sharma has Published 556 Articles

How to pass an argument to the event handler in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:25:27

1K+ Views

In most situations, the callback functions can refer to as an Instance Method. An instance method accesses all its members and performs operations with them without specifying any arguments.Let's consider a case where more than one component is defined and we want to handle some events with those components. To ... Read More

How to open a new window by the user pressing a button in a tkinter GUI?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:23:31

13K+ Views

Tkinter creates a default window (i.e., master or root window) for every application. In tkinter, we can create a Popup window or a child window by defining a Toplevel(master) constructor. This will allow the tkinter application to create another window which can be resized dynamically by defining its size property.ExampleIn ... Read More

How to list available font families in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:21:57

3K+ Views

Tkinter font property is one of the most valuable properties used to customize a widget's default font. We have already seen so many fonts and used them in our widgets, but sometimes, it seems complicated to guess which font is applicable in the Tkinter library. Python Tkinter is more specific ... Read More

How to keep selections highlighted in a Tkinter Listbox?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:17:11

940 Views

Let us consider a situation for a particular system that we have to keep selecting multiple files from a directory and once copied in the clipboard paste all of them into another directory. The idea of making the multiple selections in ListBoxes can be done by using the exportselection property. ... Read More

How to justify text in label in tkinter in Python Need justify in tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:16:52

8K+ Views

Tkinter Label widgets are used to add images and create text in a particular application. There are various functions and methods available in the library which can be used to style the widgets and its property. In order to justify the text in the label widget, we can use the ... Read More

How to increase the font size of a Text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:16:33

556 Views

We can customize the Tkinter widget by modifying the value of its properties such as font-family, text-size, text-size, width, the height of the frame, etc. Tkinter Text widgets are generally used for accepting multiline user input. It is similar to a standard text widget.To configure the text properties of the ... Read More

How to horizontally center a widget using a grid() in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

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

8K+ Views

As the name suggests, a grid is nothing but a set of rows and columns. Tkinter grid manager works similarly; it places the widget in a 2-dimensional plane to align the device through its position vertically and horizontally.Let us consider an example where we want to make the widget centered ... Read More

How to hide or disable the mouse pointer in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:15:52

3K+ Views

There are several ways to disable and enable a particular widget in a Tkinter application. However, if we want to control the Tkinter window components such as mouse cursor, control icons, toolbars, then Tkinter provides several built-in functions which can be used to configure the Tkinter window objects.To hide or ... Read More

How to have image and text in one button in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:14:00

5K+ Views

We can load the images in a Tkinter application using the PhotoImage(image location) function, which takes the image location as the parameter and displays the image on the window object. However, when we try to add an image to the button, it generally appears on the button while hiding the ... Read More

How to create a child window and communicate with parents in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:13:17

2K+ Views

Unlike other Python libraries, Tkinter has many features that are used to create a full-fledged application. It supports multiple window operations and threading for processing the operation on Windows.Following the thread, we will create an application that will pull the data from root window and put it into a child ... Read More

Advertisements