PmwColor.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:ecel 作者: ARL-UTEP-OC 项目源码 文件源码
def _recolorTree(widget, oldpalette, newcolors):
    # Change the colors in a widget and its descendants.

    # Change the colors in <widget> and all of its descendants,
    # according to the <newcolors> dictionary.  It only modifies
    # colors that have their default values as specified by the
    # <oldpalette> variable.  The keys of the <newcolors> dictionary
    # are named after widget configuration options and the values are
    # the new value for that option.

    for dbOption in newcolors.keys():
        option = string.lower(dbOption)
        try:
            value = str(widget.cget(option))
        except:
            continue
        if oldpalette is None or value == oldpalette[dbOption]:
            apply(widget.configure, (), {option : newcolors[dbOption]})

    for child in widget.winfo_children():
       _recolorTree(child, oldpalette, newcolors)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号