Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Python-Addin On/Off-button

$
0
0
Hello,

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

Code:

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

Viewing all articles
Browse latest Browse all 2485

Trending Articles