Select to view content in your preferred language

Is it possible to show a 'busy' mouse pointer while a addin tool is working?

3136
3
04-27-2014 06:50 PM
TimBarnes
Frequent Contributor
I have a python addin tool which takes about 5-8 seconds to complete its processing which is just long enough for the user to wonder if it's working or not- Is it possible to either change the pointer to show the 'busy' icon or provide another way to show that the tool is working/busy?

Originally I put a simple warning in a .messageBox saying 'This tool takes a while to work, please be patient' but this requires the user to click 'OK' every time which isn't ideal.

Cheers
Tags (2)
0 Kudos
3 Replies
TimBarnes
Frequent Contributor
Anybody?
You will receive many internet points if you help me :cool:
0 Kudos
T__WayneWhitley
Honored Contributor
I was waiting for someone to answer this....but I'm curious how this works (I haven't tried it yet), the cursor property of the tool class:

http://resources.arcgis.com/en/help/main/10.2/index.html#//014p00000027000000

Cursor ID #2 is the hourglass....doesn't appear to be animated though, sorry (because that would be cool).


Seems there is *almost* an example here of it in action with __init__(self):

http://resources.arcgis.com/en/help/main/10.2/index.html#//014p0000001q000000


If you can't get it working, I'll take a shot at it when I get more time....but please post back if you do.  I see what you mean about letting users know it is actually working and not get click-happy.

Wayne


EDIT:  The above applies to a tool - what if it is a 'button' add-in?....apparently there's an image property but I haven't played with that either and I don't know if you can change that during runtime (probably not because these props are stored in config.xml and by runtime I imagine it is not possible to reread properties):

Image (optional)
This should be a 16-by-16 pixel image used to symbolize your button. The image format should be one of the commonly used formats (that is, .bmp, .jpg, and so on). The image will be copied to the Images folder created in your add-in project.
http://resources.arcgis.com/en/help/main/10.2/index.html#/button/014p0000001z000000/

Then again, the button class has a 'checked' property that shows the button as if in a depressed state (false by default, which is the 'undepressed' state).
http://resources.arcgis.com/en/help/main/10.2/index.html#//014p00000029000000
0 Kudos
TimBarnes
Frequent Contributor
Mine is a button so I don't think the cursor properties will work unfortunately- I tried adding it but it just ignores it.

The image for the button is listed in the config xml- I am using one of those, but it's simply an icon for the button and not dynamic (apart from through the 'checked' property)....I might look at changing that property though.

The 'busy' cursor does appear sometimes by itself, but only when the code is being processed, it doesn't appear to show the 'busy' cursor when you are calling a geo-process or when that process is doing its thing....and those are the parts that take the longest time.

So it doesn't look like it's possible but your post was helpful 🙂
0 Kudos