MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / set_tooltip

Method set_tooltip

PySimpleGUI/PySimpleGUI.py:1485–1499  ·  view source on GitHub ↗

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip'). :param tooltip_text: the text to show in tooltip. If None then no tip will be shown :type tooltip_text: str |

(self, tooltip_text)

Source from the content-addressed store, hash-verified

1483 self.user_bind_dict.pop(bind_string, None)
1484
1485 def set_tooltip(self, tooltip_text):
1486 """
1487 Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').
1488
1489 :param tooltip_text: the text to show in tooltip. If None then no tip will be shown
1490 :type tooltip_text: str | None
1491 """
1492
1493 if self.TooltipObject:
1494 try:
1495 self.TooltipObject.leave()
1496 except:
1497 pass
1498
1499 self.TooltipObject = ToolTip(self.Widget, text=tooltip_text, timeout=DEFAULT_TOOLTIP_TIME)
1500
1501
1502 def remove_tooltip(self):

Callers 4

mainFunction · 0.80
Demo_Tooltips.pyFile · 0.80
mainFunction · 0.80
updateMethod · 0.80

Calls 2

ToolTipClass · 0.85
leaveMethod · 0.80

Tested by

no test coverage detected