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__/zoomheight.cpython-310.opt-1.pyc
o

�ik�@stdZddlZddlZddlZGdd�de�ZGdd�d�Zdd�Zd	d
�Ze	dkr8ddl
mZed
ddd�dSdS)z Zoom a window to maximum height.�Nc@seZdZdS)�WmInfoGatheringErrorN)�__name__�
__module__�__qualname__�rr�//usr/local/lib/python3.10/idlelib/zoomheight.pyrsrc@s2eZdZiZdd�Zd
dd�Zdd�Zdd	�ZdS)�
ZoomHeightcCs||_|jj|_dS�N)�editwin�top)�selfr
rrr�__init__szZoomHeight.__init__NcCsF|��}|dur|j��dS|rdnd}|jjdd|�d�d�dS)NZRestoreZZoom�optionsz* Heightz Height)Zmenu�indexZlabel�break)�zoom_heightrZbellr
Zupdate_menu_label)r�event�zoomedZmenu_statusrrr�zoom_height_events
�
�zZoomHeight.zoom_height_eventcCsx|j}t|�\}}}}|��dkrdSz|��\}}Wn
ty%YdSw||kr5t|||||f�dS|�d�dS)N�normalT�F)r�get_window_geometry�wm_state�get_max_height_and_y_coordr�set_window_geometry�wm_geometry)rr�widthZheight�x�y�	maxheight�maxyrrrr!s�
zZoomHeight.zoom_heightcCs�|j}|��|��f}||jvry|��}z|�d�Wntjy'td��w|��t	|�\}}}}t
jdkr;d}|��}|�d�|��t	|�}	|	dd�|f}
t
||
�|��|��}|||7}||f|j|<t
||	�|�|�|j|S)Nrz_Failed getting geometry of maximized windows, because the "zoomed" window state is unavailable.�win32rr�)rZwinfo_screenwidthZwinfo_screenheight�_max_height_and_y_coordsr�tkinterZTclErrorr�updater�sys�platformZwinfo_rootyr)rrZscreen_dimensionsZ
orig_stateZmaxwidthrZmaxxr ZmaxrootyZ	orig_geomZ
max_y_geomZmax_y_geom_rootyrrrr<s<�
��





z%ZoomHeight.get_max_height_and_y_coordr	)rrrr#r
rrrrrrrrs
rcCs&|��}t�d|�}ttt|����S)Nz(\d+)x(\d+)\+(-?\d+)\+(-?\d+))r�re�match�tuple�map�int�groups)rZgeom�mrrrrnsrcCs|�dj|��dS)Nz{:d}x{:d}+{:d}+{:d})r�format)rZgeometryrrrrtsr�__main__)�mainz!idlelib.idle_test.test_zoomheight�F)�	verbosity�exit)�__doc__r(r&r$�	ExceptionrrrrrZunittestr1rrrr�<module>sb�