HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/idlelib/__pycache__/calltip_w.cpython-310.opt-2.pyc
o

�i��@s�	ddlmZmZmZmZddlmZdZdZdZ	dZ
dZdZGd	d
�d
e�Z
dd�Zed
krHddlmZedddd�ddlmZee�dSdS)�)�Label�LEFT�SOLID�TclError)�TooltipBasez<<calltipwindow-hide>>)z<Key-Escape>z
<FocusOut>z<<calltipwindow-checkhide>>)z<KeyRelease>z<ButtonRelease>�dZcalltipwindowregion_rightcsteZdZ	�fdd�Zdd�Z�fdd�Z�fdd�Zd	d
�Zddd
�Zdd�Z	�fdd�Z
dd�Zdd�Z�Z
S)�
CalltipWindowcsF	tt|��|�d|_|_d|_|_|_d|_|_	d|_
dS�N)�superr�__init__�label�text�	parenline�parencol�lastline�hideid�checkhideid�checkhide_after_id)�selfZtext_widget��	__class__��./usr/local/lib/python3.10/idlelib/calltip_w.pyrs
zCalltipWindow.__init__cCs�	t|j�d��d�d�}||jkr|j|jf}n|df}|j�d|�}|s8t|j�d��}d|d<d|d<|dd|d|dfS)N�insert�.rz%d.%d���)�int�
anchor_widget�index�splitrrZbbox�list)r�curlineZanchor_indexZboxrrr�get_position#s
zCalltipWindow.get_positioncsN	t|j�d��d�d�}||jkrdS||_|j�d�tt|���dS)Nrrr)	rrr r!rZseer
r�position_window)rr#rrrr%2s
zCalltipWindow.position_windowcs`	||_|js
|jsdS|j�t|�tt|j�|��d��\|_	|_
tt|��
�|��dS)Nr)r
�	tipwindowrZmark_set�
MARK_RIGHT�maprr r!rrr
r�showtip�_bind_events)rr
Z	parenleftZ
parenrightrrrr);s�zCalltipWindow.showtipc
Cs4	t|j|jtddtd|jdd�|_|j��dS)Nz#ffffd0Zblackr�font)r
ZjustifyZ
backgroundZ
foregroundZreliefZborderwidthr+)rr&r
rrrr�pack�rrrr�showcontentsPs�zCalltipWindow.showcontentsNcCs�	|jsdStt|j�d��d��\}}||jks+||jkr#||jks+|j�ddt	�r1|�
�dS|��|jdurA|j�
|j�|j�t|j�|_dS)Nrr�>�break)r&r(rrr r!rrZcomparer'�hidetipr%rZafter_cancel�after�CHECKHIDE_TIME�checkhide_event)r�eventr#Zcurcolrrrr4Xs 
�
�zCalltipWindow.checkhide_eventcCs	|jsdS|��dS)Nr0)r&r1)rr5rrr�
hide_eventss
zCalltipWindow.hide_eventc	s�	|jsdSz|j��Wn	tyYnwd|_d|_|_|_z|j�t	�Wn	ty4Ynwz|�
�WnttfyFYnwtt
|���dSr	)r&rZdestroyrrrrrZ
mark_unsetr'�_unbind_events�
ValueErrorr
rr1r-rrrr1{s*���zCalltipWindow.hidetipcCsj	|j�t|j�|_tD]	}|j�t|�q|j�t|j�|j�t	|j
�|_tD]	}|j�t	|�q)dSr	)
r�bind�CHECKHIDE_EVENTr4r�CHECKHIDE_SEQUENCES�	event_addr2r3�
HIDE_EVENTr6r�HIDE_SEQUENCES�r�seqrrrr*�s���zCalltipWindow._bind_eventscCsb	tD]	}|j�t|�q|j�t|j�d|_tD]	}|j�t|�q|j�t|j�d|_dSr	)	r;rZevent_deleter:Zunbindrr>r=rr?rrrr7�s
zCalltipWindow._unbind_eventsr	)�__name__�
__module__�__qualname__rr$r%r)r.r4r6r1r*r7�
__classcell__rrrrrs
	
rcs�ddlm}m}m}m}||�}|�d�tt|���	d�dd��\}}|�d|d|df�||�}|j
||dd	�|�d
d�|��t
|���fdd
�}	�fdd�}
|�dd�|�dd�|�d|	�|�d|
�|��dS)Nr)�Toplevel�Textr�BOTHzTest call-tips�+rz
250x100+%d+%d��)Zside�fill�expandrzstring.splitcs��ddd�dS)Nz(s='Hello world')r�end)r)�r5�Zcalltiprr�calltip_show�sz%_calltip_window.<locals>.calltip_showcs���dSr	)r1rNrOrr�calltip_hide�sz%_calltip_window.<locals>.calltip_hidez<<calltip-show>>�(z<<calltip-hide>>�))�tkinterrErFrrG�titler(rZgeometryr!r,r�updaterr<r9Z	focus_set)�parentrErFrrG�top�x�yr
rPrQrrOr�_calltip_window�s"
 r[�__main__)�mainz idlelib.idle_test.test_calltip_wrF)�	verbosity�exit)�runN)rTrrrrZidlelib.tooltiprr=r>r:r;r3r'rr[rAZunittestr]Zidlelib.idle_test.htestr`rrrr�<module>s$�