diff --git a/subtitle_sync.py b/subtitle_sync.py index abad8da..a8ce93f 100644 --- a/subtitle_sync.py +++ b/subtitle_sync.py @@ -43,6 +43,16 @@ class Colors: class Tooltip: """Modern tooltip implementation""" def __init__(self, widget, text, delay=500): + """ + Initialize a Tooltip for a given Tkinter widget. + + Creates a tooltip instance that will display `text` near `widget` after `delay` milliseconds when the pointer enters the widget; it also binds pointer leave and button events to hide the tooltip. + + Parameters: + widget (tk.Widget): The widget to attach the tooltip to. + text (str): The message to display in the tooltip. + delay (int): Milliseconds to wait after pointer enter before showing the tooltip. + """ self.widget = widget self.text = text self.delay = delay @@ -54,9 +64,26 @@ def __init__(self, widget, text, delay=500): widget.bind('