Sindbad~EG File Manager
�
&Μg � � � d Z ddl� G d� d� Z G d� de� Z G d� de� Zd � Zed
k( r ddlmZ edd
d�� ddl m
Z
e
e� yy)z�Tools for displaying tool-tips.
This includes:
* an abstract base-class for different kinds of tooltips
* a simple text-only Tooltip class
� )�*c �: � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
y )
�TooltipBasez abstract base class for tooltipsc � � || _ d| _ y)z�Create a tooltip.
anchor_widget: the widget next to which the tooltip will be shown
Note that a widget will only be shown when showtip() is called.
N)�
anchor_widget� tipwindow)�selfr s �,/usr/local/lib/python3.12/idlelib/tooltip.py�__init__zTooltipBase.__init__
s � � +������ c �$ � | j � y �N��hidetip�r s r
�__del__zTooltipBase.__del__ s � ����r c � � | j ryt | j � x| _ }|j d� |j j dd|j dd� | j � | j � | j j � | j j � y# t $ r Y �`w xY w)zdisplay the tooltipN� z!::tk::unsupported::MacWindowStyle�style�help�noActivates)r �Toplevelr �wm_overrideredirect�tk�call�_w�TclError�position_window�showcontents�update_idletasks�lift�r �tws r
�showtipzTooltipBase.showtip s� � ��>�>��&�t�'9�'9�:�:����
���q�!� �
�E�E�J�J�:�G�R�U�U��}�
.�
�����������'�'�)��������
� �� �s �)B: �: C�Cc �� � | j � \ }}| j j � |z }| j j � |z }| j j d||fz � y)z&(re)-set the tooltip's screen position�+%d+%dN)�get_positionr �winfo_rootx�winfo_rootyr �wm_geometry)r �x�y�root_x�root_ys r
r zTooltipBase.position_window/ sb � �� � �"���1��#�#�/�/�1�A�5���#�#�/�/�1�A�5�����"�"�8�v�v�.>�#>�?r c �@ � d| j j � dz fS )z(choose a screen position for the tooltip� r )r �winfo_heightr s r
r'