Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python2.7/idlelib/dynOptionMenuWidget.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�`^c@s�dZddlmZmZmZmZmZddlZddlZdefd��YZ	d�Z
edkr�ddlm
Z
e
e
�ndS(	sd
OptionMenu widget modified to allow dynamic menu reconfiguration
and setting of highlightthickness
i�(t
OptionMenut_setittTkt	StringVartButtonNt
DynOptionMenucBs#eZdZd�Zdd�ZRS(sF
    unlike OptionMenu, our kwargs can include highlightthickness
    cOstj|�}d|j�kr+|d=ntj||||||�|jd|jd��||_|jd�|_dS(Nthighlightthicknesstcommand(tcopytkeysRt__init__tconfigtgettvariableR(tselftmasterR
tvaluetvaluestkwargst
kwargsCopy((s1/sys/lib/python2.7/idlelib/dynOptionMenuWidget.pyR
s
	c	Csn|djdd�x:|D]2}|djd|dt|j||j��qW|rj|jj|�ndS(s�
        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
        tmenuitendtlabelRN(tdeletetadd_commandRR
Rtset(Rt	valueListRtitem((s1/sys/lib/python2.7/idlelib/dynOptionMenuWidget.pytSetMenus
N(t__name__t
__module__t__doc__R
tNoneR(((s1/sys/lib/python2.7/idlelib/dynOptionMenuWidget.pyR
s	c	s�t�}|jd�t|�}ttttjd|j����\}}}}|jd||df�|j	d�t
||dddd	���j��fd
�}t|ddd
|�}|j�|j
�dS(NsTets dynamic option menus[x+]s+%d+%di�sOld option settold1told2told3told4cs#�jddddgdd�dS(Ntnew1tnew2tnew3tnew4Rsnew option set(R((tdyn(s1/sys/lib/python2.7/idlelib/dynOptionMenuWidget.pytupdate0sttextsChange option setR(RttitleRtlisttmaptinttretsplittgeometryRRtpackRtmainloop(	tparenttroottvartwidththeighttxtyR*tbutton((R)s1/sys/lib/python2.7/idlelib/dynOptionMenuWidget.pyt_dyn_option_menu&s	
3


t__main__(trun(RtTkinterRRRRRRR0RR=Rtidlelib.idle_test.htestR?(((s1/sys/lib/python2.7/idlelib/dynOptionMenuWidget.pyt<module>s(	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.