krank42

Python-Addin On/Off-button

Discussion created by krank42 on Mar 13, 2013
Latest reply on Aug 1, 2016 by rastrauch
Hello,

is it possible to build an on/off-button in a toolbar, that activates a different toolbar. I tried the following snippet:

class ButtonClass5(object):
    """Implementation for GLADIS_Hilfe_addin.button (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        counter += 1
        status = counter % 2
        if counter == 1:
            (id of the toolbar).enable = True
        elif:
            (id of the toolbar).enable = False
        pass


Is this possible, or can I only enable buttons?

Thanks a lot,


Karsten

Outcomes