Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
simpledialog.cpython-314.pyc126 linesDownload Raw Back to __pycache__
1+
2��i�-����Rt^RI5^RIHtHt^RIHt!RR4t!RR]4tRR	ltR3t	!RR]4t4!R
R]54tRt!RR]64t
Rt!RR]74tRt]R8Xd
Rt]!4R#R#)a&This modules handles dialog boxes.8 9It contains the following public symbols:10 11SimpleDialog -- A simple but flexible modal dialog box12 13Dialog -- a base class for dialogs14 15askinteger -- get an integer from the user16 17askfloat -- get a float from the user18 19askstring -- get a string from the user20)�*)�_get_temp_root�_destroy_temp_root)�21messageboxc�Na�]tRt^toR.RRRR3RltRtRtRtRtRt	Vt22R#)	�SimpleDialog�Nc���V'd\WR7VnM\V4VnV'd7VPPV4VPPV4\	VP4\VPVRR7VnVPP^\R7\VP4Vn23VPP4W@nWPnW@n
VPPRVP4\!\#V44F`pW8,p	\%VPV	W3RlR7p24W�8XdV25P'\(^R7V26P\*\^R7Kb	VPP-R	VP.4VPP1V4\3VPV4R27#))�class_i�)�text�aspect)�expand�fill�<Return>c�$�VPV4#�N)�done��self�nums&&�Lib\tkinter\simpledialog.py�<lambda>�'SimpleDialog.__init__.<locals>.<lambda>9s��4�9�9�S�>��r�command)�relief�borderwidth)�siderr
�WM_DELETE_WINDOWN)�Toplevel�root�title�iconname�
_setup_dialog�Message�message�pack�BOTH�Frame�framer�cancel�default�bind�return_event�range�len�Button�config�RIDGE�LEFT�protocol�wm_delete_window�	transient�
_place_window)r�masterr�buttonsr,r+r"r28r�s�bs&&&&&&&&   r�__init__�SimpleDialog.__init__!sW��� ��7�D�I� ��(�D�I���I�I�O�O�E�"��I�I���u�%��d�i�i� ��t�y�y�t�C�@�����������.��4�9�9�%��29��30�31�����������	�	���z�4�#4�#4�5���W��&�C���A��t�z�z��,0� I�L�A��~�����1��5�
�F�F��4��F�2�
'�	
�	�	���-�t�/D�/D�E��	�	���F�#��d�i�i��(rc���VPP4VPP4VPP4VPP	4VP32#r)r!�wait_visibility�grab_set�mainloop�destroyr�rs&r�go�SimpleDialog.goAsK���	�	�!�!�#��	�	�����	�	�����	�	�����x�x�rc��VPfVPP4R#VPVP4R#r)r,r!�bellr�r�events&&rr.�SimpleDialog.return_eventHs*���<�<���I�I�N�N���I�I�d�l�l�#rc��VPfVPP4R#VPVP4R#r)r+r!rHrrDs&rr6�SimpleDialog.wm_delete_windowNs*���;�;���I�I�N�N���I�I�d�k�k�"rc�F�WnVPP4R#r)rr!�quitrs&&rr�SimpleDialog.doneTs�����	�	���r)r+r,r*r&rr!)�__name__�33__module__�__qualname__�__firstlineno__r=rEr.r6r�__static_attributes__�__classdictcell__��
__classdict__s@rrrs4�����"�d�4��D�)�@�$�#��rrc�`a�]tRt^YtoRtRRltRtRtRtRRlt	RRlt34R	tR35tRt
VtR#)
�DialogzRClass to open dialogs.36 37This class is intended as a base class for custom dialogs38Nc��TpVf\4p\PW4VP4Ve(VP	4'dVPV4V'dVP
V4\V4WnRVn	\V4pVPV4VnVP^^R7VP4VPfWnVPRVP 4\#W4VPP%4VP'4VP)4VP+V4R#)zxInitialize a dialog.39 40Arguments:41 42    parent -- a parent window (the application window)43 44    title -- the dialog title45N)�padx�padyr)rr r=�withdraw�winfo_viewabler7r"r$�parent�resultr)�body�
initial_focusr'�	buttonboxr5r+r8�	focus_setr@rA�wait_window)rr`r"r9rbs&&&  rr=�Dialog.__init__`s	�����>�#�%�F����$�'��
�
����&�"7�"7�"9�"9��N�N�6�"���J�J�u���d��������T�{��!�Y�Y�t�_����	�	�q�q�	�!��������%�!%���
�
�(�$�+�+�6��d�#����$�$�&�	
�����
�
������rc�h�RVn\PV4\VP4R#)zDestroy the windowN)rcr rCrr9rDs&rrC�Dialog.destroy�s$��!���������4�;�;�'rc��R#)z�create dialog body.46 47return widget that should have initial focus.48This method should be overridden, and is called49by the __init__ method.50N�)rr9s&&rrb�Dialog.body����	
rc�z�\V4p\VR^51VP\R7pVP	\52^^R7\VR^53VPR7pVP	\54^^R7VPRVP4VPRVP4VP	4R#)	zKadd standard button box.55 56override if you do not want the standard buttons57�OK)r�widthrr,)rr\r]�Cancel)rrprrz<Escape>N)r)r1�ok�ACTIVEr'r4r+r-)r�box�ws&  rrd�Dialog.buttonbox�s����D�k���3�T��T�W�W�f�M��	���D�q�q��)��3�X�R����E��	���D�q�q��)��	�	�*�d�g�g�&��	�	�*�d�k�k�*����58rc��VP4'gVPP4R#VP4VP	4VP4VP
4R# TP
4i;ir)�validatercrer^�update_idletasks�applyr+rIs&&rrr�	Dialog.ok�sX���}�}������(�(�*���
�
������	��J�J�L��K�K�M��D�K�K�M�s�A6�6Bc�v�VPeVPP4VP4R#r)r`rerCrIs&&rr+�
Dialog.cancel�s'���;�;�"��K�K�!�!�#����rc��^#)z�validate the data59 60This method is called automatically to validate the data before the61dialog is destroyed. By default, it always validates OK.62rkrDs&rrx�Dialog.validate�s��rc��R#)z�process the data63 64This method is called automatically to process the data, *after*65the dialog is destroyed. By default, it does nothing.66NrkrDs&rrz�Dialog.apply�rmr)rcr`rar)rQrRrSrT�__doc__r=rCrbrdrrr+rxrzrUrVrWs@rrZrZYs8�����671�f(�
��*���
�
rrZNc���VP4VP4VP4pVP4pVP	4pVP4pVEeVP
4'd�VP4VP4V,68^,,pVP4VP4V,69^,,pVP4pVP4p	\WhV,V,704p\Wh4p\WyV,V,714p\Wy4pVPR8Xd
\V^4pM<VP!4V,72^,pVP#4V,73^,pVP%WE4VP'RWg3,4VP)4R#)N�aquaz+%d+%d)�wm_withdrawry�winfo_reqwidth�winfo_reqheight�winfo_vrootwidth�winfo_vrootheight�winfo_ismapped�winfo_rootx�winfo_width�winfo_rooty�winfo_height�winfo_vrootx�winfo_vrooty�min�max�_windowingsystem�winfo_screenwidth�winfo_screenheight�74wm_maxsize�wm_geometry�wm_deiconify)75rur`�minwidth�	minheight�maxwidth�	maxheight�x�y�vrootx�vrootys76&&        rr8r8�st���M�M�O��������!�H��!�!�#�I��!�!�#�H��#�#�%�I�
��f�3�3�5�5���� �F�$6�$6�$8�8�$C��#I�I����� �F�$7�$7�$9�I�$E�!�#K�K�����!�����!����H�$�x�/�0����N����I�%�	�1�2����N������'��A�r�77�A��
�
 �
 �
"�X�
-�!�3��
�
!�
!�
#�i�
/�A�5���L�L��%��M�M�(�a�V�#�$��N�N�rc��VPR8Xd"VPPRRVRR4R#VPR8XdVPRR7R#R#)	r�z!::tk::unsupported::MacWindowStyle�style�
moveableModalr�x11�dialog)�typeN)r��tk�call�
wm_attributes)rus&rr$r$sM�����V�#�	���	�	�5�w��_�b�	*�	78�	�	�u�	$�	���X��&�79%rc�<a�]tRtRtoRRltRtRtRtRtVt	R#)	�_QueryDialogiNc�b�W nW@nWPnW0n\PWV4R#r)�prompt�minvalue�maxvalue�initialvaluerZr=)rr"r�r�r�r�r`s&&&&&&&rr=�_QueryDialog.__init__s'��80�� �
� �
�(������e�,rc�>�RVn\PV4R#r)�entryrZrCrDs&rrC�_QueryDialog.destroys����81����t�rc��\WP\R7pVP^^\R7\VRR7VnVPP^^\\,R7VPeGVPP^VP4VPP^\4VP#))r�justify)�rowr\�stickyr�)�name)�Labelr�r4�grid�W�Entryr��Er��insert�select_range�END)rr9rus&& rrb�_QueryDialog.body!s����&�{�{�D�9��	���1�1�Q��'��6��0��82��83�84���A�A�a��c��2����(��J�J���a��!2�!2�3��J�J�#�#�A�s�+��z�z�rc���VP4pTP85e=YP868d-\P!RRTP87,TR7^#TPe=YP8�d-\P!RRTP,TR7^#Yn^# \d/\P!RTPR,TR7^#i;i)z
Illegal valuez88Please try again)r`z	Too smallz2The allowed minimum value is %s. Please try again.z	Too largez2The allowed maximum value is %s. Please try again.)�	getresult�89ValueErrorr�showwarning�errormessager�r�ra)rras& rrx�_QueryDialog.validate/s���	��^�^�%�F��=�=�$��-�-�)?��"�"��$�&*�m�m�4��	
���=�=�$��-�-�)?��"�"��$�&*�m�m�4��	
������9�	��"�"���!�!�$8�8��
�90�
	�s�B.�.5C'�&C')r�r�r�r�r�ra)NNNN)91rQrRrSrTr=rCrbrxrUrVrWs@rr�r�s����-����rr�c�*a�]tRtRtoRtRtRtVtR#)�
_QueryIntegeriQzNot an integer.c�T�VPVPP44#r)�getintr��getrDs&rr��_QueryInteger.getresultTs���{�{�4�:�:�>�>�+�,�,rrkN�rQrRrSrTr�r�rUrVrWs@rr�r�Qs����$�L�-�-rr�c�2�\W3/VBpVP#)z�get an integer from the user92 93Arguments:94 95    title -- the dialog title96    prompt -- the label text97    **kw -- see SimpleDialog class98 99Return value is an integer100)r�ra�r"r��kw�ds&&, r�101askintegerr�Xs��	�e�*�r�*�A��8�8�Orc�*a�]tRtRtoRtRtRtVtR#)�_QueryFloatigzNot a floating-point value.c�T�VPVPP44#r)�	getdoubler�r�rDs&rr��_QueryFloat.getresultjs���~�~�d�j�j�n�n�.�/�/rrkNr�rWs@rr�r�gs����0�L�0�0rr�c�2�\W3/VBpVP#)z�get a float from the user102 103Arguments:104 105    title -- the dialog title106    prompt -- the label text107    **kw -- see SimpleDialog class108 109Return value is a float110)r�rar�s&&, r�askfloatr�ns��	�E�(�R�(�A��8�8�Orc�2a�]tRtRtoRtRtRtRtVtR#)�_QueryStringi}c�z�RV9dVR,VnVRMRVn\P!V.VO5/VBR#)�showN)�_QueryString__showr�r=)r�argsr�s&*,rr=�_QueryString.__init__~s:���R�<��V�*�D�K��6�111��D�K����d�0�T�0�R�0rc��\PW4pVPeVPVPR7V#)N)r�)r�rbr��	configure)rr9r�s&& rrb�_QueryString.body�s3���!�!�$�/���;�;�"��O�O����O�-��rc�6�VPP4#r)r�r�rDs&rr��_QueryString.getresult�s���z�z�~�~��r)�__showN)	rQrRrSrTr=rbr�rUrVrWs@rr�r�}s����1�� � rr�c�2�\W3/VBpVP#)z�get a string from the user112 113Arguments:114 115    title -- the dialog title116    prompt -- the label text117    **kw -- see SimpleDialog class118 119Return value is a string120)r�rar�s&&, r�	askstringr��s��	�U�)�b�)�A��8�8�Or�__main__c���\4pV3Rlp\VRVR7pVP4\VRVPR7pVP4VP	4R#)c	���\VR.R121O^^RR7p\VP44\\RR^�R74\\	RR^^dR74\\RR44R	#)z�This is a test dialog.  Would this have been an actual dialog, the buttons below would have been glowing in soft pink light.122Do you believe this?zTest Dialog)rr:r,r+r"�Spamz	Egg count)r�zEgg weight123(in tons))r�r�z	Egg labelN)�Yes�Norq)r�printrEr�r�r�)r!r�s& r�doit�test.<locals>.doit�si���T�5�124"9�!"� !�,�	.�A�
�!�$�$�&�M��*�V�[�u�E�F��(�6�#:�Q�$'�)�
*��)�F�K�0�1r�Testr�QuitN)�Tkr1r'rOrB)r!r��t�qs    r�testr��sN���t���	2� 
�4�f�d�3��	�����4�f�a�f�f�5��	����	�125�126�rr)r��tkinterrrrrr rZr8r$r�r�r�r�r�r�r�rQr�rkrr�<module>r�s���
��6��7�7�tI
�X�I
�\�:'�@�6�@�F-�L�-��0�,�0�� �<� �&��z���0	�F�5r
codekingpro/portable-devtools · Team Ai