Khillstrom

Controlling State with Python Add-In

Discussion created by Khillstrom on Feb 28, 2013
Latest reply on Feb 28, 2013 by cfox-esristaff
I am trying to control the state of one button using another and nothing I have tried so far has worked. This is what should work. Any suggestions?

import arcpy
import pythonaddins

class ButtonClass1(object):
    
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        ButtonClass2.enabled = False
        pass

class ButtonClass2(object):
    
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        pass


What is the point of having these properties if you cannot set and reset them?
http://resources.arcgis.com/en/help/main/10.1/index.html#/Managing_the_state_of_Python_add_in_types/014p0000001s000000/

Outcomes