wxpython组合框可防止用户在选择某个选项后选择其他选项
我想锁定组合框,它可以防止用户在输入开始按钮后选择任何其他内容 这是因为我正在对一个接口进行监视。组合框中有接口名称列表。一旦我启动了监视器,我不希望用户选择其他接口卡,直到它停止 有什么办法吗wxpython组合框可防止用户在选择某个选项后选择其他选项,python,Python,我想锁定组合框,它可以防止用户在输入开始按钮后选择任何其他内容 这是因为我正在对一个接口进行监视。组合框中有接口名称列表。一旦我启动了监视器,我不希望用户选择其他接口卡,直到它停止 有什么办法吗 selectedInterface = self.interfaces_cblist.GetValue() self.selectInterfaceStr = str(selectedInterface) if len(selectedInterface) ==
selectedInterface = self.interfaces_cblist.GetValue()
self.selectInterfaceStr = str(selectedInterface)
if len(selectedInterface) == 0:
noSelect_error = wx.MessageDialog(None,"Please select an interface","",wx.OK|wx.ICON_ERROR)
noSelect_error.ShowModal()
else:
monitorStarted = wx.MessageDialog(None,"Monitor on %s started"%self.selectInterfaceStr,"",wx.OK|wx.ICON_ERROR)
monitorStarted.ShowModal()
self.monitorInterface_button.Disable()
self.abortValue = 1;
self.camDetect = multiprocessing.Process(target=self.camtableDetection,args=(self.selectInterfaceStr,))
self.dhcpDetect = multiprocessing.Process(target=self.dhcpexhaustion,args=(self.selectInterfaceStr,))
self.camDetect.start()
self.dhcpDetect.start()
如果要禁用combobox,您应该能够执行以下操作:
self.interfaces_cblist.Enable(False)
(假设interfaces_cblist是要禁用的组合框…)