- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do I display tooltips in Tkinter?
Tooltips are useful in applications where we need to display some information while hovering on a button.
In order to create and display a tooltip, we can use the Balloon property of tkinter.
Example
#Import the tkinter library from tkinter import * from tkinter.tix import * #Create an instance of tkinter frame win = Tk() #Set the geometry win.geometry("600x450") #Create a tooltip tip = Balloon(win) #Create a Button widget my_button=Button(win, text= "Hover Me") my_button.pack(pady=20) #Bind the tooltip with button tip.bind_widget(my_button,balloonmsg="www.tutorialspoint.com") win.mainloop()
Output
The above code will display the following window with a button "Hover Me". When the user hovers over the button, it will show a tooltip text.
- Related Articles
- How can I display an image using Pillow in Tkinter?
- How do I close a tkinter window?
- How do I use PIL with Tkinter?
- How do I change button size in Python Tkinter?
- How do I create a date picker in tkinter?
- How do I create a popup window in Tkinter?
- How do I set a minimum window size in Tkinter?
- How do I handle the window close event in Tkinter?
- How do I use Window Manager (wm) attributes in Tkinter?
- How do I open a website in a Tkinter window?
- How do I create child windows with Python tkinter?
- How do I update images on a Tkinter Canvas?
- How do I create a popup window using Tkinter?
- How do I change the background of a Frame in Tkinter?
- How do I center the text in a Tkinter Text widget?

Advertisements