Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.147.69.91
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : tooltip.cpython-311.pyc
�

TfG����dZddlTGd�d��ZGd�de��ZGd�de��Zd	�Zed
kr'ddlmZedd
d���ddl	m
Z
e
e��dSdS)z�Tools for displaying tool-tips.

This includes:
 * an abstract base-class for different kinds of tooltips
 * a simple text-only Tooltip class
�)�*c�<�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	S)
�TooltipBasez abstract base class for tooltipsc�"�||_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)�selfrs  �8/usr/local/python-3.11/lib/python3.11/idlelib/tooltip.py�__init__zTooltipBase.__init__
s��+��������c�.�|���dS�N��hidetip�r	s r
�__del__zTooltipBase.__del__s���������rc��|jrdSt|j��x|_}|�d��	|j�dd|jdd��n#t$rYnwxYw|���|�	��|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	�tws  r
�showtipzTooltipBase.showtips����>�	��F�&�t�'9�:�:�:����
���q�!�!�!�	�
�E�J�J�:�G�R�U��}�
.�
.�
.�
.���	�	�	��D�	����	
��������������'�'�)�)�)���������s�#A�
A,�+A,c���|���\}}|j���|z}|j���|z}|j�d||fz��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_ys     r
rzTooltipBase.position_window/so��� � �"�"���1��#�/�/�1�1�A�5���#�/�/�1�1�A�5����"�"�8�v�v�.>�#>�?�?�?�?�?rc�>�d|j���dzfS)z(choose a screen position for the tooltip�r)r�winfo_heightrs r
r'zTooltipBase.get_position6s#���4�%�2�2�4�4�q�8�8�8rc��t�)z$content display hook for sub-classes)�NotImplementedErrorrs r
rzTooltipBase.showcontentsAs
��"�!rc�v�|j}d|_|r(	|���dS#t$rYdSwxYwdS�zhide the tooltipN)r�destroyrr"s  r
rzTooltipBase.hidetipFs\���^�����
�	�
��
�
��������
�
�
����
����	�	s�(�
6�6N)�__name__�
__module__�__qualname__�__doc__rrr$rr'rr�rr
rr
s�������*�*����������*@�@�@�	9�	9�	9�"�"�"�
	�	�	�	�	rrc�T��eZdZdZd�fd�	Z�fd�Zdd�Zdd�Zd�Zd	�Z	�fd
�Z
�xZS)
�OnHoverTooltipBasez?abstract base class for tooltips, with delayed on-hover display��c�D��t���|��||_d|_|j�d|j��|_|j�d|j��|_	|j�d|j��|_
dS)aqCreate 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>)�superr�hover_delay�	_after_idr�bind�_show_event�_id1�_hide_event�_id2�_id3)r	rrD�	__class__s   �r
rzOnHoverTooltipBase.__init__Us����	������'�'�'�&�������&�+�+�I�t�7G�H�H��	��&�+�+�I�t�7G�H�H��	��&�+�+�J��8H�I�I��	�	�	rc�,��	|j�d|j��|j�d|j��|j�d|j��n#t
$rYnwxYwt
�����dS)Nr@rArB)r�unbindrHrJrKrrCr�r	rLs �r
rzOnHoverTooltipBase.__del__gs����	���%�%�i���;�;�;���%�%�i���;�;�;���%�%�j�$�)�<�<�<�<���	�	�	��D�	����
���������s�A A$�$
A1�0A1Nc�h�|jr|���dS|���dS)z$event handler to display the tooltipN)rD�scheduler$�r	�events  r
rGzOnHoverTooltipBase._show_eventps/����	��M�M�O�O�O�O�O��L�L�N�N�N�N�Nrc�.�|���dS)z!event handler to hide the tooltipNrrRs  r
rIzOnHoverTooltipBase._hide_eventws���������rc��|���|j�|j|j��|_dS)z*schedule the future display of the tooltipN)�
unscheduler�afterrDr$rErs r
rQzOnHoverTooltipBase.schedule{s<���������+�1�1�$�2B�26�,�@�@����rc�^�|j}d|_|r|j�|��dSdS)z(cancel the future display of the tooltipN)rEr�after_cancel)r	�after_ids  r
rVzOnHoverTooltipBase.unschedule�s?���>������	6���+�+�H�5�5�5�5�5�	6�	6rc���	|���n#t$rYnwxYwt�����dSr5)rVrrCrrOs �r
rzOnHoverTooltipBase.hidetip�sU���	��O�O�������	�	�	��D�	����
���������s��
%�%�r>r)r7r8r9r:rrrGrIrQrVr�
__classcell__�rLs@r
r=r=Rs��������I�I�J�J�J�J�J�J�$�������������@�@�@�6�6�6���������rr=c�*��eZdZdZd�fd�	Zd�Z�xZS)�HovertipzAA tooltip that pops up when a mouse hovers over an anchor widget.r>c�\��t���||���||_dS)avCreate a text 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.
        �rDN)rCr�text)r	rrcrDrLs    �r
rzHovertip.__init__�s-���	������K��@�@�@���	�	�	rc��t|j|jtdtd���}|���dS)Nz#ffffe0r)rc�justify�
background�relief�borderwidth)�Labelrrc�LEFT�SOLID�pack)r	�labels  r
rzHovertip.showcontents�s;���d�n�4�9�d�!*�5�a�I�I�I��
�
�
�����rr\)r7r8r9r:rrr]r^s@r
r`r`�sR�������G�G�������������rr`c�8�t|��}|�d��tt|����d��dd���\}}|�d||dzfz��t
|d���}|���t|d���}|���t|d	d
���t|d���}|���t|d
d���dS)NzTest tooltip�+rr&�zPlace your mouse over buttons)rcz"Button 1 -- 1/2 second hover delayz!This is tooltip text for button1.i�rbzButton 2 -- no hover delayz!This is tooltip
text for button2.)
r�title�map�int�geometry�splitrirl�Buttonr`)�parent�topr+r,rm�button1�button2s       r
�_tooltipr{�s��
�6�
�
�C��I�I�n�����s�F�O�O�%�%�+�+�C�0�0����4�5�5�D�A�q��L�L��Q��C��L�(�)�)�)��#�;�<�<�<�E�	�J�J�L�L�L��S�C�D�D�D�G��L�L�N�N�N��W�9�s�K�K�K�K��S�;�<�<�<�G��L�L�N�N�N��W�:��M�M�M�M�M�Mr�__main__)�mainzidlelib.idle_test.test_tooltip�F)�	verbosity�exit)�runN)r:�tkinterrr=r`r{r7�unittestr}�idlelib.idle_test.htestr�r;rr
�<module>r�s��������E�E�E�E�E�E�E�E�P<�<�<�<�<��<�<�<�~�����!����*N�N�N��z����������D�	)�Q�U�C�C�C�C�+�+�+�+�+�+��C��M�M�M�M�M��r
© 2025 GrazzMean