I have created a python add-in tool which uses onMouseDownMap to get an xy coordinate on my MXD.
Here is the code:
class ToolTester2(object):
"""Implementation for Toot_Test_2_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.shape = "NONE"
def onMouseDownMap(self, x, y, button, shift):
pythonaddins.MessageBox("x = "+str(x)+", y = "+str(y))
The problem is that once I click the tool there is a little blue line around the button and it stays active even after I get my xy coordinate message. If I click anywhere on the map the message fire off again. If I click on another tool on the toolbar then it stops. I want to turn off that functionality that happen when the blue line is there.
My questions are:
1) What is that state called when the blue line appears (i.e. checked, enabled)?
2) how can I turn it off and still keep the tool button clic-able?
P.S. I don't want to disable the tool (as in tool.enabled = False) because I can't click on it then.
Thank you very much for any help.
Here is the code:
class ToolTester2(object):
"""Implementation for Toot_Test_2_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.shape = "NONE"
def onMouseDownMap(self, x, y, button, shift):
pythonaddins.MessageBox("x = "+str(x)+", y = "+str(y))
The problem is that once I click the tool there is a little blue line around the button and it stays active even after I get my xy coordinate message. If I click anywhere on the map the message fire off again. If I click on another tool on the toolbar then it stops. I want to turn off that functionality that happen when the blue line is there.
My questions are:
1) What is that state called when the blue line appears (i.e. checked, enabled)?
2) how can I turn it off and still keep the tool button clic-able?
P.S. I don't want to disable the tool (as in tool.enabled = False) because I can't click on it then.
Thank you very much for any help.







