Your IP : 18.220.196.68
3
��2a� � @ sX d dl Z d dlmZmZmZmZ G dd� de�Zdd� ZedkrTd dl m
Z
e
e� dS ) � N)�
OptionMenu�_setit� StringVar�Buttonc @ s e Zd Zdd� Zddd�ZdS )�
DynOptionMenuc O s` t j |�}dt|j� �kr |d= tj| |||f|�|� | j|jd�d� || _|jd�| _d S )N�highlightthickness)r �command) �copy�list�keysr �__init__�config�get�variabler )�selfZmasterr �value�values�kwargsZ
kwargsCopy� r �./opt/alt/python36/lib64/python3.6/dynoption.pyr
s
zDynOptionMenu.__init__Nc C sP | d j dd� x*|D ]"}| d j|t| j|| j�d� qW |rL| jj|� d S )NZmenur �end)Zlabelr )�deleteZadd_commandr r r �set)r Z valueListr �itemr r r �SetMenu s
zDynOptionMenu.SetMenu)N)�__name__�
__module__�__qualname__r r r r r r r s r c s� ddl m} || �}|jd� tt| j� jd�dd � �\}}|jd|d |d f � |j� t|�}|j d � t
||d
ddd
�� � j� � fdd�}t|d|d�}|j� d S )Nr )�ToplevelzTets dynamic option menu�+� z
200x100+%d+%d� � zOld option setZold1Zold2Zold3Zold4c s � j ddddgdd� d S )NZnew1Znew2Znew3Znew4znew option set)r )r r )�dynr r �update3 s z _dyn_option_menu.<locals>.updatezChange option set)�textr )
�tkinterr �title�map�intZgeometry�splitZ focus_setr r r �packr )�parentr �top�x�y�varr$ Zbuttonr )r# r �_dyn_option_menu% s
r1 �__main__)�run)r r&