B /g^8 @srddlmZmZddlZGdddZeZejZejZejZGdddeZ e dkrnddl m Z e d d d dS) )ToplevelTclErrorNc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS) WindowListcCsi|_g|_dS)N)dict callbacks)selfr&/usr/lib64/python3.7/idlelib/window.py__init__szWindowList.__init__cCs||j||jt|<dS)N)Z after_idlecall_callbacksrstr)rwindowrrr add s zWindowList.addcCs2y|jt|=Wntk r$YnX|dS)N)rr KeyErrorr )rr rrr deletes zWindowList.deletec Csg}xL|jD]B}|j|}y |}Wntk r<w YnX||||fq W|x"|D]\}}}|j||jdq`WdS)N)ZlabelZcommand)r get_titlerappendsortZ add_commandwakeup)rZmenulistkeyr titlerrr add_windows_to_menus   zWindowList.add_windows_to_menucCs|j|dS)N)rr)rcallbackrrr register_callback$szWindowList.register_callbackcCs*y|j|Wntk r$YnXdS)N)rremove ValueError)rrrrr unregister_callback'szWindowList.unregister_callbackc CsHxB|jD]8}y |Wqt\}}}td|d|YqXqWdS)Nz&warning: callback failed in WindowList:)rsysexc_infoprint)rrtvtbrrr r -s   zWindowList.call_callbacksN) __name__ __module__ __qualname__r rrrrrr rrrr rs rc@s4eZdZddZddZddZddZd d Zd S) ListedToplevelcKs"t|||t|||_dS)N)rr registryrfocused_widget)rZmasterkwrrr r ?s zListedToplevel.__init__cCs&t|t|tjs"|dS)N)r)rrdestroyrquit)rrrr r,Ds  zListedToplevel.destroycCs tdS)N)r)r )rr rrr update_windowlist_registryLsz)ListedToplevel.update_windowlist_registrycCs|S)N)Zwm_title)rrrr rOszListedToplevel.get_titlecCsLy2|dkr||||jWntk rFYnXdS)NZiconic)Zwm_stateZ wm_withdrawZ wm_deiconifyZtkraiser*Z focus_setr)rrrr rSs zListedToplevel.wakeupN)r%r&r'r r,r.rrrrrr r(=s r(__main__)mainzidlelib.idle_test.test_window) verbosity) Ztkinterrrrrr)rrrr(r%Zunittestr0rrrr s1#