0

我想锁定组合框,以防止用户在输入开始按钮后选择其他任何内容。

这是因为我在一个接口上做了一个监控过程。组合框有接口名称列表。一旦我启动监控器,我不希望用户选择其他接口卡,直到它停止。

有什么办法吗?

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()
4

1 回答 1

0

如果您想禁用您的组合框,您应该能够执行以下操作:

self.interfaces_cblist.Enable(False)

(假设 interfaces_cblist 是您要禁用的组合框...)

于 2013-11-07T08:00:03.703 回答