Dev Prakash Sharma has Published 556 Articles

How do I create a popup window in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 09:05:57

26K+ Views

Popup window in Tkinter can be created by defining the Toplevel(win) window. A Toplevel window manages to create a child window along with the parent window. It always opens above all the other windows defined in any application. We can create a top-level window or child window by initializing the ... Read More

How can I set the default value of my Tkinter Scale widget slider to 100?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 09:04:01

1K+ Views

Tkinter Scale Widgets are used to provide the visual representation of data items where we can modify or change the value of data items. In order to change the state of data or select multiple data in the field, we can use the Scale widget.The Scale Widget can be created ... Read More

How can I put two buttons next to each other in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 09:01:35

6K+ Views

Tkinter generally provides three general ways to define the geometry of the widgets. They are − Place, Pack, and Grid Management. If we use the Pack geometry manager, then place the two buttons in the frame using side property. It places the buttons horizontally stacked in the window in (Left, Right, ... Read More

How can I insert a string in an Entry widget that is in the "readonly" state using Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 08:58:54

600 Views

Tkinter Entry widget is used to insert single-line text input. We can use the Entry widget to create forms where single-line input is the prime requirement.Sometimes, we need to insert a predefined text inside the Entry Widget. In such cases, we can use insert(INSERT, ) method. These are generally called ... Read More

Default to and select the first item in Tkinter Listbox

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 08:50:24

3K+ Views

Tkinter Listbox widgets are used to display a scrollable list of items with vertically stacked menus. Sometimes, we may need to set the list item selected, by default. We can use the select_set(list_item_index) method by specifying the index of the list items that need to be selected by default.So, let ... Read More

Create multiple buttons with "different" command function in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 08:46:56

6K+ Views

A Button can be initialized using the for loop in a Tkinter application. Let us suppose that we want to create multiple buttons, each with different commands or operations defined in it. We have to first initialize the Button inside a for loop. The iterator will return the object for which multiple ... Read More

Converting Tkinter program to exe file

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 08:44:24

17K+ Views

Let us suppose that we want to create a standalone app (executable application) using tkinter. We can convert any tkinter application to an exe compatible file format using the PyInstaller package in Python.To work with pyinstaller, first install the package in the environment by using the following command, pip install pyinstallerOnce ... Read More

Change the color upon hovering over Button in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 08:40:58

4K+ Views

Let us suppose that we are creating an application in which we want to change the color of the Button widget while we hover upon it. We can have the hovering property by defining the Event Callbacks.To change the color of the Button while hovering on it, we have to ... Read More

Binding mouse double click in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 03-May-2021 07:44:15

2K+ Views

Let us suppose that for a particular application, we want to bind the mouse double-click so that it performs some event or operation. We can use the bind(‘’, handler) or bind(‘’, handler) methods to bind the mouse Left or Right Buttons with a handler or a callback function.ExampleIn this example, ... Read More

Automatically close window after a certain time in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 30-Apr-2021 21:26:25

6K+ Views

In order to close a Tkinter application, we generally refer to close the parent window using the destroy() method. To close the Tkinter window automatically after a certain time limit, we have to use the after(time in ms, callback) method by specifying the time and the callback function which needs ... Read More

Advertisements