[?@sVddlTGdddZddZedkrRddlmZeendS) )*c@seZdZdZddZddZddZdd Zd d Zd d Z ddZ dZ ddZ ddZ ddZddZddZddZddZdd ZdS)! ScrolledListz(None)cKs9||_t||_}|jjddddt|dd|_}|jjdddd t|d d d d |_}|r|j|n|jdddd|j |d<|j |d<|j d|j |j d|j |j d|j|j d|j|j d|j|jdS)NZfillZbothexpandnamevbarZsiderightyZexportselectionrZ backgroundZwhiteZcommandZyscrollcommandzzzzz )masterZFrameframeZpackZ ScrollbarrZListboxlistboxZ configureZyviewsetZbind click_eventdouble_click_event popup_eventup_event down_eventclear)selfr Zoptionsr rr r*/usr/lib/python3.4/idlelib/ScrolledList.py__init__s$   zScrolledList.__init__cCs|jjdS)N)r Zdestroy)rrrrcloseszScrolledList.closecCs6|jjddd|_|jjd|jdS)Nrendr)r deleteemptyinsertdefault)rrrrr"s zScrolledList.clearcCsE|jr(|jjddd|_n|jjdt|dS)Nrr)rr rrstr)ritemrrrappend's  zScrolledList.appendcCs|jj|S)N)r get)rindexrrrr!-szScrolledList.getcCsP|jjd|j|jf|jjd}|j||j|dS)Nz@%d,%dactivebreak)r activatexr r"select on_select)reventr"rrrr0s    zScrolledList.click_eventcCs0|jjd}|j||j|dS)Nr#r$)r r"r' on_double)rr)r"rrrr7s  zScrolledList.double_click_eventNcCsx|js|jn|j}|jjd|j|jf|jjd}|j||j|j |j dS)Nz@%d,%dr#) menu make_menur r%r&r r"r'Ztk_popupZx_rootZy_root)rr)r+r"rrrr?s     zScrolledList.popup_eventcCs,t|jdd}||_|jdS)NZtearoffr)ZMenur r+ fill_menu)rr+rrrr,Hs zScrolledList.make_menucCs~|jjd}|jj|r1|d}n|jjd}|dkr`|jjn|j||j|dS)Nr#rrr$)r r"selection_includessizebellr'r()rr)r"rrrrMs    zScrolledList.up_eventcCsz|jjd}|jj|r1|d}nd}||jjkr\|jjn|j||j|dS)Nr#rrr$)r r"r.r/r0r'r()rr)r"rrrrZs   zScrolledList.down_eventcCsT|jj|jj||jjdd|jj||jj|dS)Nrr)r Z focus_setr%Zselection_clearZ selection_setZsee)rr"rrrr'gs  zScrolledList.selectcCsdS)Nr)rrrrr-pszScrolledList.fill_menucCsdS)Nr)rr"rrrr(sszScrolledList.on_selectcCsdS)Nr)rr"rrrr*vszScrolledList.on_double)__name__ __module__ __qualname__rrrrr r!rrr+rr,rrr'r-r(r*rrrrrs"           rc Cst}|jdttttjd|j\}}}}|jd||dfGdddt}||}x%t dD]}|j d|qW|j dS) NzTest ScrolledListz[x+]z+%d+%dc@s4eZdZddZddZddZdS)z&_scrolled_list..MyScrolledListcSs|jjdddS)NZlabelz right click)r+Z add_command)rrrrr-sz0_scrolled_list..MyScrolledList.fill_menucSstd|j|dS)Nr')printr!)rr"rrrr(sz0_scrolled_list..MyScrolledList.on_selectcSstd|j|dS)NZdouble)r5r!)rr"rrrr*sz0_scrolled_list..MyScrolledList.on_doubleN)r1r2r3r-r(r*rrrrMyScrolledLists   r6z Item %02d) ZTktitlelistmapintresplitZgeometryrranger Zmainloop) parentrootwidthZheightr&r r6Z scrolled_listirrr_scrolled_listzs  3 rC__main__)runN)ZtkinterrrCr1Zidlelib.idle_test.htestrErrrrs w