mς
­fIc           @   ss   d  Z  d k Td k Z d e f d     YZ e d j o6 e   Z e e d d d d	   i	   e i
   n d S(
   s   Simple text browser for IDLE

(   t   *Nt
   TextViewerc           B   s8   t  Z d  Z e d  Z d   Z d   Z e d  Z RS(   s,   
    simple text viewer dialog for idle
    c         C   s,  t  i |  |  |  i d d  |  i d d d | i   d | i   d f  d |  _ d |  _	 |  i
   |  i |  |  i |  |  i   |  i d	 |  i  | |  _ |  i i   |  i d
 |  i  |  i d |  i  | o |  i i d |  n |  i |  |  i i d t  |  i   d S(   s   If data exists, load it into viewer, otherwise try to load file.

        fileName - string, should be an absoulute filename
        t   borderwidthi   s   =%dx%d+%d+%diq  iτ  i
   s   #ffffffs   #000000t   WM_DELETE_WINDOWs   <Return>s   <Escape>f0.0t   stateN(   t   Toplevelt   __init__t   selft   parentt	   configuret   geometryt   winfo_rootxt   winfo_rootyt   bgt   fgt   CreateWidgetst   titlet	   transientt   grab_sett   protocolt   Okt   textViewt	   focus_sett   bindt   datat   insertt   LoadTextFilet   fileNamet   configt   DISABLEDt   wait_window(   R   R   R   R   R   (    (    t-   /mit/python/lib/python2.4/idlelib/textView.pyR      s(     1		

	c         C   si   d  } y t | d  } Wn0 t j
 o$ t i d d d d | f  n X|  i i	 d | i
    d  S(   Nt   rR   s   File Load Errort   messages   Unable to load file %r .f0.0(   t   Nonet   textFilet   openR   t   IOErrort   tkMessageBoxt	   showerrorR   R   R   t   read(   R   R   R#   (    (    R   R   +   s    c      
   C   sC  t  |  d t d d } t  |   } t | d d d |  i d t |  _ t	 | d t
 d t d	 d
 |  _ t | d t d	 d
 d |  i d |  i |  _ |  i i d |  i i  |  i i d |  i i  |  i i   |  i i d t d t  |  i i d t d t d t  | i d t d t  | i d t d t d t  d  S(   Nt   relieft   heightiΌ  t   textt   Closet   commandt	   takefocust   orientt   highlightthicknessi    t   wrapR   R   t   yscrollcommandt   sidet   fillt   expand(   t   FrameR   t   SUNKENt	   frameTextt   frameButtonst   ButtonR   t   FALSEt   buttonOkt	   Scrollbart   VERTICALt   scrollbarViewt   Textt   WORDR   R   R   R   t   yviewt   sett   packt   RIGHTt   Yt   LEFTt   TRUEt   BOTHt   BOTTOMt   Xt   TOP(   R   R8   R9   (    (    R   R   5   s    c         C   s   |  i   d  S(   N(   R   t   destroy(   R   t   event(    (    R   R   F   s    (   t   __name__t
   __module__t   __doc__R"   R   R   R   R   (    (    (    R   R      s
    	
	t   __main__R+   t   ViewR-   c           C   s   t  t d d  S(   NR@   s   ./textView.py(   R   t   root(    (    (    R   t   <lambda>M   s    (   RQ   t   TkinterR&   R   R   RO   t   TkRT   R:   RD   t   mainloop(   R   R&   RT   (    (    R   t   ?   s   	A	