0

我正在为 arcgis 使用 python 插件,当我单击另一个按钮时,我试图禁用一个按钮。问题是我的代码不起作用,请帮助!

class ButtonSelectRetire(object):

    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):        

        cbr = ButtontRetire()
        cbr.off()     

class ButtontRetire(object):

    def __init__(self):
        self.enabled = True
        self.checked = False

    def onClick(self):
    pass

    def on (self):
        self.enable = True

    def off (self):
        self.enable = False
4

1 回答 1

0

我假设您想禁用ButtontRetireButtonSelectRetire。小心意图。在这里,您可以找到一个简短明了的 pythonaddins 初学者视频教程(附答案)。

class ButtonSelectRetire(object):

    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        ButtontRetire.enabled = False

class ButtontRetire(object):

    def __init__(self):
        self.enabled = True
        self.checked = False

    def onClick(self):
        pass
于 2017-04-28T17:48:06.103 回答