python (3.12.0)

(root)/
lib/
python3.12/
idlelib/
__pycache__/
calltip_w.cpython-312.pyc

̑edZddlmZmZmZmZddlmZdZdZ	dZ
dZdZd	Z
Gd
deZdZed
k(r ddlmZedddddlmZeeyy)zvA call-tip window class for Tkinter/IDLE.

After tooltip.py, which uses ideas gleaned from PySol.
Used by calltip.py.
)LabelLEFTSOLIDTclError)TooltipBasez<<calltipwindow-hide>>)z<Key-Escape>z
<FocusOut>z<<calltipwindow-checkhide>>)z<KeyRelease>z<ButtonRelease>dcalltipwindowregion_rightcfeZdZdZfdZdZfdZfdZdZddZ	dZ
fd	Zd
ZdZ
xZS)

CalltipWindowz+A call-tip widget for tkinter text widgets.ct||dx|_|_dx|_x|_|_dx|_|_d|_	y)z}Create a call-tip; shown by showtip().

        text_widget: a Text widget with code for which call-tips are desired
        N)
super__init__labeltext	parenlineparencollastlinehideidcheckhideidcheckhide_after_id)selftext_widget	__class__s  E/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/idlelib/calltip_w.pyrzCalltipWindow.__init__sL	%!%%
TY9===)--d&"&ct|jjdjdd}||jk(r|j|j
f}n|df}|jj
d|z}|s.t|jj
d}d|d<d|d<|ddz|d|dzfS)z$Choose the position of the call-tip.insert.rz%d.%d)int
anchor_widgetindexsplitrrbboxlist)rcurlineanchor_indexboxs    rget_positionzCalltipWindow.get_position#sd((..x8>>sCAFGdnn$ NNDMM:L#Q<L  %%g&<=t))..x89CCFCF1vz3q6CF?**rct|jjdjdd}||jk(ry||_|jjdt|y)z Reposition the window if needed.rrrN)r"r#r$r%rseer
position_window)rr(rs  rr.zCalltipWindow.position_window2scd((..x8>>sCAFGdmm#
x(
!rcL||_|js|jsy|jjt|tt|jj|jd\|_	|_
t|1|jy)a_Show the call-tip, bind events which will close it and reposition it.

        text: the text to display in the call-tip
        parenleft: index of the opening parenthesis in the text widget
        parenright: index of the closing parenthesis in the text widget,
                    or the end of the line if there is no closing parenthesis
        Nr)r	tipwindowr#mark_set
MARK_RIGHTmapr"r$r%rrr
showtip_bind_events)rr	parenleft
parenrightrs    rr4zCalltipWindow.showtip;s	>>##J
;(+##)))4::3?)A%
	rct|j|jtddtd|j
d|_|jjy)zCreate the call-tip widget.z#ffffd0blackr font)rjustify
background
foregroundreliefborderwidthr:N)rr0rrrr#rpack)rs rshowcontentszCalltipWindow.showcontentsPsD4>>		4&/G"'Q $ 2 26 :<
	

rc2|jsytt|jj	djd\}}||jks?||jk(r||jks!|jjddtr|jy|j|j%|jj|j|jjt|j |_y)z4Handle CHECK_HIDE_EVENT: call hidetip or reschedule.Nrr>break)r0r3r"r#r$r%rrcomparer2hidetipr.rafter_cancelafterCHECKHIDE_TIMEcheckhide_event)reventr(curcols    rrJzCalltipWindow.checkhide_eventXs~~c4#5#5#;#;H#E#K#KC#PQT^^#t~~%&DMM*A%%hZ@LLN	
"".++D,C,CD$$^T5I5IJ	
rc>|jsy|jy)z%Handle HIDE_EVENT by calling hidetip.NrD)r0rF)rrKs  r
hide_eventzCalltipWindow.hide_eventss~~rcr|jsy	|jjd|_dx|_x|_|_	|jjt	|jt|5y#t$rYgwxYw#t$rY:wxYw#ttf$rY>wxYw)zHide the call-tip.N)r0rdestroyrrrrr#
mark_unsetr2_unbind_events
ValueErrorr
rF)rrs rrFzCalltipWindow.hidetip{s~~	JJ 
9===	))*5	!
	!				
*%		s5BB'B$	BB	B! B!$B65B6c|jjt|j|_t
D]"}|jj
t|$|jjt|j|jjt|j|_tD]"}|jj
t|$y)zBind event handlers.N)
r#bindCHECKHIDE_EVENTrJrCHECKHIDE_SEQUENCES	event_addrHrI
HIDE_EVENTrNrHIDE_SEQUENCESrseqs  rr5zCalltipWindow._bind_eventss--22?373G3GI&	?C((#>	?  1E1EF((--j.2oo?!	:C((S9	:rcttD]"}|jjt|$|jj	t|j
d|_tD]"}|jjt|$|jj	t|jd|_y)zUnbind event handlers.N)	rWr#event_deleterVunbindrrZrYrr[s  rrRzCalltipWindow._unbind_eventss&	BC++OSA	B!!/43C3CD!	=C++J<	=!!*dkk:rN)__name__
__module____qualname____doc__rr+r.r4rArJrNrFr5rR
__classcell__)rs@rrrs85'
+"*62
:	rrcDddlm}m}m}m}||}|jdt
t|jjddd\}}|jd|dz|dzfz||}|j||d	|jd
d|jt|fd}	fd
}
|jdd|jdd|jd|	|jd|
|j!y)Nr)ToplevelTextrBOTHzTest call-tips+r z
250x100+%d+%d)sidefillexpandrzstring.splitc,jdddy)Nz(s='Hello world')rend)r4rKcalltips rcalltip_showz%_calltip_window.<locals>.calltip_shows+Xu=rc&jyr`)rFrrs rcalltip_hidez%_calltip_window.<locals>.calltip_hides
rz<<calltip-show>>(z<<calltip-hide>>))tkinterrgrhrrititler3r"geometryr%r@rupdaterrXrU	focus_set)parentrgrhrritopxyrrtrvrss           @r_calltip_windowrs22
6
CIIsFOO%++C045DAqLLAGQW#5569DII4d1I-KK.)JJLD!G>NN%s+NN%s+II ,/II ,/NNr__main__)mainz idlelib.idle_test.test_calltip_wrF)	verbosityexit)runN)rdryrrrridlelib.tooltiprrYrZrVrWrIr2rrraunittestridlelib.idle_test.htestrrr<module>rsr
10'
%
//9
(
VKVr0z	+quE+r