Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 禁用Pmw.ComboBox小部件的输入字段_Python_User Interface_Combobox_Tkinter - Fatal编程技术网

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

Python 禁用Pmw.ComboBox小部件的输入字段,python,user-interface,combobox,tkinter,Python,User Interface,Combobox,Tkinter,我正在寻找一种方法来禁用对Pmw.ComboBox小部件的直接编辑。使用entry\u field=DISABLED的小部件配置会导致组合框变灰且不可用。这是我的代码,允许直接编辑菜单: dropdownQOS = Pmw.ComboBox(parentWindow, label_text = 'QOS: ', labelpos = 'w', selectioncommand = differentiateS

我正在寻找一种方法来禁用对
Pmw.ComboBox
小部件的直接编辑。使用
entry\u field=DISABLED
的小部件配置会导致组合框变灰且不可用。这是我的代码,允许直接编辑菜单:

        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)
查看此页面:
entryfield\u entry\u state=DISABLED
对我来说也可以禁用组合框的条目。

查看此页面:
entryfield\u entry\u state=DISABLED
对我禁用组合框条目也很有效。

谢谢,将组合框条目状态配置为
entry\u field=DISABLED
做了完全相同的事情,但另外将条目固定为灰色,不允许进一步更改背景色。虽然不是交易破坏者。我用
entryfield\u entry\u state=DISABLED
entry\u field=DISABLED
尝试了你的代码,两个都用
'readoly'
参数,而不是
DISABLED
。组合框工作正常,其输入字段不可编辑。在这4例中,只有输入字段的颜色不同。如果你的组合框没有关闭,这意味着它被禁用。(或者我们可能没有使用相同版本的python、tkinter或Pmw。我使用Py3.3、Tk8.5、Pmw2.0。)太好了,将
entry\u field设置为
'readonly'
完全实现了我想要的;禁用编辑条目的选项,但不使字段完全变灰(与使用禁用的
相比)。谢谢你抽出时间!谢谢,将组合框输入状态配置为
entry\u field=DISABLED
可以实现完全相同的功能,但会将输入固定为灰色,而不允许进一步更改背景颜色。虽然不是交易破坏者。我用
entryfield\u entry\u state=DISABLED
entry\u field=DISABLED
尝试了你的代码,两个都用
'readoly'
参数,而不是
DISABLED
。组合框工作正常,其输入字段不可编辑。在这4例中,只有输入字段的颜色不同。如果你的组合框没有关闭,这意味着它被禁用。(或者我们可能没有使用相同版本的python、tkinter或Pmw。我使用Py3.3、Tk8.5、Pmw2.0。)太好了,将
entry\u field设置为
'readonly'
完全实现了我想要的;禁用编辑条目的选项,但不使字段完全变灰(与使用禁用的
相比)。谢谢你抽出时间!