我正在使用python添加进入arcgis,我试图在我点击另一个按钮时禁用一个按钮。问题是我的代码无效,请帮助!
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
答案 0 :(得分:0)
我假设您要使用ButtontRetire
类禁用ButtonSelectRetire
。小心意图。 Here你可以找到一个简短而直截了当的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