禁用Pmw.ComboBox小部件的输入字段

时间:2013-03-25 15:36:36

标签: python user-interface combobox tkinter

我正在寻找一种禁用直接编辑Pmw.ComboBox小部件的方法。使用entry_field=DISABLED结果的窗口小部件配置带有灰色且无法使用的ComboBox。这是我的代码,允许直接编辑菜单:

        dropdownQOS = Pmw.ComboBox(parentWindow,
            label_text = 'QOS: ',
            labelpos = 'w',
            selectioncommand = differentiateSettings,
            scrolledlist_items = ("Selection1", "Selection2", "Selection3"), 
            listheight = 57,  entry_width = 43)
        dropdownQOS.selectitem(0, setentry = 1)
        dropdownQOS.pack(anchor = 'n',fill = 'x', expand = 1, padx = 50, pady=5)

1 个答案:

答案 0 :(得分:1)

查看此页面:http://www.gossamer-threads.com/lists/python/python/63351 entryfield_entry_state=DISABLED也为我工作,禁用组合框输入。