
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.
Advertisements