Dev Prakash Sharma has Published 548 Articles

How to put a Tkinter window on top of the others?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:37:05

13K+ Views

Whenever we create a GUI program, tkinter generally presents the output screen in the background. In other words, tkinter displays the program window behind other programs. In order to put the tkinter window on top of others, we are required to use attributes('- topmost', True) property. It pulls up the ... Read More

How to set default text for a Tkinter Entry widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:33:01

7K+ Views

Tkinter Entry widget is used to print and display a single line of text taken from the user Input. It is used for many applications such as creating login forms, signup forms, and other user interaction forms.We can set the default text for the Entry Widget using insert() function by passing ... Read More

How to set the border color of certain Tkinter widgets?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:31:05

3K+ Views

Let us suppose we want to change the border color of a tkinter widget. We can configure the widget by passing the highlightcolor, highlightbackground property of the widget.ExampleIn this example, we have created an Entry widget and a button that can be triggered to change the border color of the ... Read More

How to set the text/value/content of an 'Entry' widget using a button in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:29:12

10K+ Views

Tkinter Entry widget is used to display a single line text. Using tkinter Entry widget, we can set its value or content by triggering a button. It has mainly two types of operation: insert and delete.Using the Tkinter Button widget, we will set the content of the Entry widget.Example#Import the ... Read More

Modify the default font in Python Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:24:31

4K+ Views

In order to change the default behavior of tkinter widgets, we generally override the option_add() method. The properties and values passed to option_add() method will reflect the changes in all the widgets in the application. Thus, changing the default font will affect the font for all the widgets defined in ... Read More

Setting Background color for Tkinter in Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:20:36

3K+ Views

We can customize the tkinter widgets using the tkinter.ttk module. Tkinter.ttk module is used for styling the tkinter widgets such as setting the background color, foreground color, activating the buttons, adding images to labels, justifying the height and width of widgets, etc.In order to add a background color in tkinter ... Read More

What is the difference between root.destroy() and root.quit() in Tkinter(Python)?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:19:20

6K+ Views

When we invoke the destroy() method with the tkinter window object, it terminates the mainloop process and destroys all the widgets inside the window. Tkinter destroy() method is mainly used to kill and terminate the interpreter running in the background.However, quit() method can be invoked in order to stop the ... Read More

What is the difference between the widgets of tkinter and tkinter.ttk in Python?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:18:53

7K+ Views

tkinter.ttk is a module that is used to style the tkinter widgets. Just like CSS is used to style an HTML element, we use tkinter.ttk to style tkinter widgets.Here are the major differences between tkinter widget and tkinter.ttk −Tkinter widgets are used to add Buttons, Labels, Text, ScrollBar, etc., however, ... Read More

Word Dictionary using Python Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 09:14:21

3K+ Views

In this article, we will create a GUI-based dictionary using PyDictionary and Tkinter Module.PyDictionary is a Python Module that helps to get meaning translations, antonyms and synonyms of words. It uses WordNet for getting meanings, Google for translations, and synonym.com for getting synonyms and antonyms. PyDictionary uses BeautifulSoup, Requests module ... Read More

Window Resizer Control Panel in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 09:08:53

426 Views

In this article, we will create a GUI-based window resizer control panel that will have a pane to resize the window by its height or width.In order to create the application, we will first create a slider that will help to resize the window size. The sliders are available in ... Read More

Advertisements