
    e"                     V   d Z ddlZddlZddlZddlmZmZ ddlmZm	Z	m
Z
mZmZ ddlmZmZmZmZmZmZmZmZmZmZ ddlmZ  e       Zej                  dk(  rej4                  dkD  rd	nd
Zn e       d   dd Z G d de      Zedk(  r ddlmZ  eddd       ddl m!Z!  e!e       yy)zAbout Dialog for IDLE

    N)python_versionarchitecture)ToplevelFrameLabelButton
PhotoImage)
SUNKENTOPBOTTOMLEFTXBOTHWEWNSEWE)textviewdarwinl        6432   c                   `    e Zd ZdZdddddZd Zd Zd Zd	 Zd
 Z	d Z
d Zd ZddZddZy)AboutDialogz!Modal about dialog for idle

    NF)_htest_utestc                   t        j                  | |       | j                  d       | j                  d|j	                         dz   |j                         |sdndz   fz         d| _        d| _        | j                          | j                  dd	       | j                  |xs d
t         dt         d       | j                  |       | j                          | j                  d| j                          || _        | j$                  j'                          | j)                  d| j                          | j)                  d| j                          d| _        || _        |s!| j/                          | j1                          yy)a  Create popup, do not return until tk widget destroyed.

        parent - parent of this dialog
        title - string which is title of popup dialog
        _htest - bool, change box location when running htest
        _utest - bool, don't wait_window when running unittest
           )borderwidthz+%d+%d   d   z#bbbbbbz#000000F)heightwidthzAbout IDLE z (z bit)WM_DELETE_WINDOWz<Return>z<Escape>N)r   __init__	configuregeometrywinfo_rootxwinfo_rootybgfgcreate_widgets	resizabletitlepyverbits	transientgrab_setprotocolokparent	button_ok	focus_setbind_current_textviewr   	deiconifywait_window)selfr5   r.   r   r   s        $lib/python3.12/idlelib/help_about.pyr%   zAboutDialog.__init__   sD    	$'1%h**,R/**,bCH"J J 	K e51

5 6 r$u5	7v($''2  "		*dgg&		*dgg&!%NN     c                 .   t        | dt              }t        |       }|j                  t        t               |j                  t
        dt               t        |d| j                        | _	        | j                  j                  dd	       t        || j                  
      }|j                  dt               t        |d| j                  | j                  d      }|j                  ddt        dd       | j                         j!                  d      }|dk\  rdnd}t"        j$                  j'                  t"        j$                  j)                  t"        j$                  j+                  t,                    dd|       }t/        | j                         |      | _        t        || j0                  | j                        }|j                  ddt2        ddd       d}	t        ||	t4        | j                  | j                        }
|
j                  ddt2        ddd       t        |dt4        | j                  | j                        }|j                  d ddt2        dd!       d"t6        j8                  d d z  }t        ||t4        | j                  | j                        j                  d#ddt2        dd!       j;                  d$fd%       t        |d&t        d| j                  '      j                  d(dt<        ddd       t?        | jA                               }||k7  rd)|z   nd*}d+tB         d,| | }t        ||| j                  | j                  -      }|j                  d.dt2        dd       t        || j                  
      }|j                  dddtD        /       t        |d0d(| j                  | jF                  1      | _$        | jH                  j                  t4        dd2       t        |d3d(| j                  | jJ                  1      | _&        | jL                  j                  t4        dd2       t        |d4d(| j                  | jN                  1      | _(        | jP                  j                  t4        dd2       t        |d&t        d| j                  '      j                  d5dt<        ddd       t        |d| j                  | j                  -      }|j                  d6dt2        dd       t        || j                  
      }|j                  d7ddtD        /       t        |d8d(| j                  | jR                  1      | _*        | jT                  j                  t4        dd2       t        |d9d(| j                  | jV                  1      | _,        | jX                  j                  t4        dd2       t        |d4d(| j                  | jZ                  1      | _.        | j\                  j                  t4        dd2       y ):Nr   )r   relief)sidefillT)rA   expandrB   Close)textcommandr   )padxpady)r*   )rC   rB   IDLE)courier   bold)rE   r+   r*   fontr   
   )rowcolumnstickyrG   rH   tk_patchLevelz8.6z.pngz.gifIconsidle_48)masterfile)imager*   )rO   rP   rQ   rowspanrG   rH   z=Python's Integrated Development
and Learning Environment




)rE   justifyr+   r*      )rO   rP   rQ   
columnspanrG   rH   zemail:  idle-dev@python.org   )rO   rP   r[   rQ   rG   rH   z/https://docs.python.org/%d.%d/library/idle.html   z
<Button-1>c                 4    t        j                  d         S )NrE   )
webbrowseropen)eventdocss    r=   <lambda>z,AboutDialog.create_widgets.<locals>.<lambda>`   s    jood6l.K r>      )r   r@   r"   r*      z and  zPython z with tcl/tk )rE   r+   r*   	   )rO   rP   r[   rQ   License)rE   r#   highlightbackgroundrF   )rA   rG   rH   	CopyrightCredits         READMENEWS)/r   r
   packr   r   r   r   r   r4   r6   r*   r   r+   gridr   _rootgetvarospathjoinabspathdirname__file__r	   
icon_imager   r   sysversion_infor8   r   strinfo_patchlevelr/   r   show_py_license
py_licenseshow_py_copyrightpy_copyrightshow_py_credits
py_creditsshow_readmereadmeshow_idle_news	idle_newsshow_idle_creditsidle_credits)r<   frameframe_buttonsframe_backgroundheadertkpatchexticonlogobyline_textbylineemaildocs_urltclvertkverversionsvers
py_buttonsidleidle_buttonsrb   s                       @r=   r,   zAboutDialog.create_widgets<   s	   d&9dQ/

Dt
4G(,1+ 4773T5'f''(?A!ABR@**,%%o65(ffww||BGGOOBGGOOH,EF#wse_6$DJJLtD%T__I		a!QRb	IZ'k4''dgg/!A!"1M&-J"tww477<

qq!
LE$$Ra()%H!dgg$'';		aa	K		, KLAf477	$$(DQq45AA %) %G T))+,%,%6'!BUG=@%HTWWM		a!"1	=+8
BqQtD )159WW)-)=)=? 	$Rb9":Kq7;ww+/+A+AC 	Dr; )159WW)-)=)=? 	$Rb9Af477	$$(DR"45AA %) %G %#77tww0 			b12A	>-$'':bqF\15%)%5%57 	d"5648GG(,(;(;= 	BR8"<iq7;ww+/+A+AC 	Dr;r>   c                 0    | j                  dt               y)zHandle License button event.zAbout - LicenseN)display_printer_textlicenser<   s    r=   r   zAboutDialog.show_py_license   s    !!"3W=r>   c                 0    | j                  dt               y)zHandle Copyright button event.zAbout - CopyrightN)r   	copyrightr   s    r=   r   zAboutDialog.show_py_copyright   s    !!"5yAr>   c                 0    | j                  dt               y)z#Handle Python Credits button event.zAbout - Python CreditsN)r   creditsr   s    r=   r   zAboutDialog.show_py_credits   s    !!":GDr>   c                 *    | j                  ddd       y)z!Handle Idle Credits button event.zAbout - CreditszCREDITS.txtutf-8Ndisplay_file_textr   s    r=   r   zAboutDialog.show_idle_credits   s    0-Ir>   c                 *    | j                  ddd       y)zHandle Readme button event.zAbout - Readmez
README.txtasciiNr   r   s    r=   r   zAboutDialog.show_readme   s    /wGr>   c                 *    | j                  ddd       y)zHandle News button event.zAbout - NEWSzNEWS.txtr   Nr   r   s    r=   r   zAboutDialog.show_idle_news   s    ~z7Cr>   c                     |j                          dj                  |j                        }t        j                  | ||| j
                        | _        y)a  Create textview for built-in constants.

        Built-in constants have type _sitebuiltins._Printer.  The
        text is extracted from the built-in and then sent to a text
        viewer with self as the parent and title as the title of
        the popup.
        
r   N)_Printer__setuprw   _Printer__linesr   	view_textr   r9   )r<   r.   printerrE   s       r=   r   z AboutDialog.display_printer_text   sD     	!yy001!)!3!3%dkk"3r>   c                    t         j                  j                  t         j                  j                  t         j                  j	                  t
                    |      }t        j                  | |||| j                        | _	        y)zCreate textview for filename.

        The filename needs to be in the current directory.  The path
        is sent to a text viewer with self as the parent, title as
        the title of the popup, and the file encoding.
        r   N)
ru   rv   rw   rx   ry   rz   r   	view_filer   r9   )r<   r.   filenameencodingfns        r=   r   zAboutDialog.display_file_text   sT     WW\\"''//"''//(*CDhO!)!3!3%Xdkk";r>   c                 D    | j                          | j                          y)zDismiss help_about dialog.N)grab_releasedestroy)r<   ra   s     r=   r4   zAboutDialog.ok   s    r>   )N)__name__
__module____qualname____doc__r%   r,   r   r   r   r   r   r   r   r   r4    r>   r=   r   r      sO     U5  DS<l>BEJHD3	;r>   r   __main__)mainz!idlelib.idle_test.test_help_aboutF)	verbosityexit)run)"r   ru   r|   r_   platformr   r   tkinterr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   idlelibr   r/   maxsizer0   r   r   unittestr   idlelib.idle_test.htestr   r   r>   r=   <module>r      s    
 
  1 > > F F F <<8;;&4DD>!Ra Dq( qh z	,F+ r>   