| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.10/idlelib/__pycache__/ |
Upload File : |
o
�9j� � @ s� d Z ddlT G dd� d�ZG dd� de�ZG dd� de�Zd d
� Zedkr>ddlmZ ed
ddd� ddl m
Z
e
e� dS dS )z�Tools for displaying tool-tips.
This includes:
* an abstract base-class for different kinds of tooltips
* a simple text-only Tooltip class
� )�*c @ sH e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dS )�TooltipBasez abstract base class for tooltipsc C s || _ d| _dS )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 � r �&/usr/lib/python3.10/idlelib/tooltip.py�__init__
s
zTooltipBase.__init__c C s | � � d S �N��hidetip�r r r r �__del__ s zTooltipBase.__del__c C sz | j rdS t| j� | _ }|�d� z
|j�dd|jdd� W n ty( Y nw | �� | � � | j �
� | j �� dS )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 �twr r r �showtip s
��
zTooltipBase.showtipc C s@ | � � \}}| j�� | }| j�� | }| j�d||f � dS )z&(re)-set the tooltip's screen position�+%d+%dN)�get_positionr �winfo_rootx�winfo_rootyr �wm_geometry)r �x�y�root_x�root_yr r r r / s zTooltipBase.position_windowc C s d| j �� d fS )z(choose a screen position for the tooltip� r )r �winfo_heightr
r r r r! 6 s zTooltipBase.get_positionc C s t �)z$content display hook for sub-classes)�NotImplementedErrorr
r r r r A s zTooltipBase.showcontentsc C s8 | j }d| _ |rz|�� W dS ty Y dS w dS �zhide the tooltipN)r �destroyr r r r r r F s ��zTooltipBase.hidetipN)�__name__�
__module__�__qualname__�__doc__r r r r r! r r r r r r r
s
r c s^ e Zd ZdZd� fdd� Z� fdd�Zddd �Zdd
d�Zdd
� Zdd� Z � fdd�Z
� ZS )�OnHoverTooltipBasez?abstract base class for tooltips, with delayed on-hover display�� c sV t t| ��|� || _d| _| j�d| j�| _| j�d| j �| _
| j�d| j �| _dS )aq Create a tooltip with a mouse hover delay.
anchor_widget: the widget next to which the tooltip will be shown
hover_delay: time to delay before showing the tooltip, in milliseconds
Note that a widget will only be shown when showtip() is called,
e.g. after hovering over the anchor widget with the mouse for enough
time.
N�<Enter>�<Leave>�<Button>)�superr2 r �hover_delay� _after_idr �bind�_show_event�_id1�_hide_event�_id2�_id3)r r r8 �� __class__r r r U s
zOnHoverTooltipBase.__init__c sZ z| j �d| j� | j �d| j� | j �d| j� W n ty# Y nw tt| ��� d S )Nr4 r5 r6 ) r �unbindr<