Your IP : 18.219.127.59


Current Path : /opt/alt/python34/lib64/python3.4/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/idlelib/__pycache__/CallTipWindow.cpython-34.pyc

�
e f��@s�dZddlmZmZmZmZmZdZdZdZ	dZ
d	Zd
ZGdd�d�Z
d
d�Zedkr�ddlmZee�ndS)z�A CallTip window class for Tkinter/IDLE.

After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
�)�Toplevel�Label�LEFT�SOLID�TclErrorz<<calltipwindow-hide>>�<Key-Escape>�
<FocusOut>z<<calltipwindow-checkhide>>�<KeyRelease>�<ButtonRelease>�dZcalltipwindowregion_rightc@sgeZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�CallTipcCsO||_d|_|_d|_|_d|_d|_|_d|_dS)N)	�widget�	tipwindow�label�	parenline�parencol�lastline�hideid�checkhideid�checkhide_after_id)�selfr
�r�:/opt/alt/python34/lib64/python3.4/idlelib/CallTipWindow.py�__init__s		zCallTip.__init__cCs(t|jjd�jd�d�}||jkr8dS||_|jjd�||jkr�|jjd|j|jf�}n|jjd|�}|s�t	|jjd��}d|d<d|d<n|d|jj
�d}|d|d	|jj�}|jj
d
||f�dS)z;Check if needs to reposition the window, and if so - do it.�insert�.rNz%d.%dz%d.0���z+%d+%d)�intr
�index�splitrZseerZbboxr�list�winfo_rootx�winfo_rootyrZwm_geometry)r�curlineZbox�x�yrrr�position_windows %	

zCallTip.position_windowcCs�||_|js|jr dS|jjt|�tt|jj|�jd��\|_	|_
t|j�|_}|j�|j
d�y#|jjdd|jdd�Wntk
r�YnXt|d|jd	td
ddtd
dd|jd�|_|jj�|j�|jjt|j�|_x!tD]}|jjt|�q>W|jjt|j�|jjt |j!�|_"x!t#D]}|jjt |�q�WdS)zMShow the calltip, bind events which will close it and reposition it.
        Nrrz!::tk::unsupported::MacWindowStyleZstyle�helpZnoActivates�textZjustifyZ
backgroundz#ffffe0ZreliefZborderwidthZfont)$r*rr
Zmark_set�
MARK_RIGHT�maprr r!rrrr(Zwm_overrideredirectZtk�callZ_wrrrrr�packZlift�bind�CHECKHIDE_VIRTUAL_EVENT_NAME�checkhide_eventr�CHECKHIDE_SEQUENCES�	event_add�after�CHECKHIDE_TIME�HIDE_VIRTUAL_EVENT_NAME�
hide_eventr�HIDE_SEQUENCES)rr*Z	parenleftZ
parenrightZtw�seqrrr�showtip/s8	-






zCallTip.showtipNcCs�|js
dStt|jjd�jd��\}}||jks|||jkrd||jks||jjddt	�r�|j
�nJ|j�|jdk	r�|jj
|j�n|jjt|j�|_dS)Nrr�>)rr,rr
r r!rrZcomparer+�hidetipr(rZafter_cancelr4r5r1)r�eventr%Zcurcolrrrr1Ws	*

zCallTip.checkhide_eventcCs|js
dS|j�dS)N)rr<)rr=rrrr7is	zCallTip.hide_eventcCs�|js
dSx!tD]}|jjt|�qW|jjt|j�d|_x!tD]}|jjt|�qWW|jjt|j	�d|_	|j
j�d|_
|jj�d|_|jjt
�d|_|_|_dS)N)rr2r
Zevent_deleter0Zunbindrr8r6rrZdestroyZ
mark_unsetr+rrr)rr9rrrr<os 	
	
	
	
	zCallTip.hidetipcCs
t|j�S)N)�boolr)rrrr�	is_active�szCallTip.is_active)
�__name__�
__module__�__qualname__rr(r:r1r7r<r?rrrrrs(rc	s&ddlm}m}m}m}||�}|jd�|jd|j�d|j�df�||�}|j	d|d|d	d
�|j
dd�|j�t|���fd
d�}�fdd�}|j
dd�|j
dd�|jd|�|jd|�|j�dS)Nr)r�Textr�BOTHz
Test calltipsz
200x100+%d+%d���ZsideZfill�expandrrzstring.splitcs�jddd�dS)Nz(s=Hello world)r�end)r:)r=)�calltiprr�calltip_show�sz%_calltip_window.<locals>.calltip_showcs�j�dS)N)r<)r=)rIrr�calltip_hide�sz%_calltip_window.<locals>.calltip_hidez<<calltip-show>>�(z<<calltip-hide>>�))�tkinterrrCrrD�titleZgeometryr#r$r.r�updaterr3r/Z	focus_set)	�parentrrCrrD�topr*rJrKr)rIr�_calltip_window�s""

rS�__main__)�runN)rr)r	r
)�__doc__rNrrrrrr6r8r0r2r5r+rrSr@Zidlelib.idle_test.htestrUrrrr�<module>s(x

?>