Your IP : 18.223.238.150


Current Path : /opt/alt/python34/lib64/python3.4/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/idlelib/__pycache__/dynOptionMenuWidget.cpython-34.pyo

�
e f��@s�dZddlZddlmZmZmZmZGdd�de�Zdd�Ze	dkrdd	l
mZee�ndS)
zd
OptionMenu widget modified to allow dynamic menu reconfiguration
and setting of highlightthickness
�N)�
OptionMenu�_setit�	StringVar�Buttonc@s1eZdZdZdd�Zddd�ZdS)�
DynOptionMenuzF
    unlike OptionMenu, our kwargs can include highlightthickness
    cOs�tj|�}dt|j��kr1|d=ntj||||||�|jd|jd��||_|jd�|_dS)NZhighlightthickness�command)	�copy�list�keysr�__init__�config�get�variabler)�selfZmasterr�value�values�kwargsZ
kwargsCopy�r�@/opt/alt/python34/lib64/python3.4/idlelib/dynOptionMenuWidget.pyrs
	zDynOptionMenu.__init__Nc	Csn|djdd�x:|D]2}|djd|dt|j||j��qW|rj|jj|�ndS)z�
        clear and reload the menu with a new set of options.
        valueList - list of new options
        value - initial value to set the optionmenu's menubutton to
        Zmenur�endZlabelrN)ZdeleteZadd_commandrrr�set)rZ	valueListr�itemrrr�SetMenus
zDynOptionMenu.SetMenu)�__name__�
__module__�__qualname__�__doc__rrrrrrrsrcs�ddlm}|�}|jd�|jd|j�d|j�df�|j�t|�}|jd�t	||dd	d
d���j
��fdd
�}t|ddd|�}|j
�dS)Nr)�ToplevelzTets dynamic option menuz
200x100+%d+%d���zOld option setZold1Zold2Zold3Zold4cs#�jddddgdd�dS)NZnew1Znew2Znew3Znew4rznew option set)rr)�dynrr�update2sz _dyn_option_menu.<locals>.update�textzChange option setr)�tkinterr�titleZgeometryZwinfo_rootxZwinfo_rootyZ	focus_setrrrZpackr)�parentr�top�varr!Zbuttonr)r r�_dyn_option_menu$s	



r(�__main__)�run)rrr#rrrrrr(rZidlelib.idle_test.htestr*rrrr�<module>s"

?>