I made an Add-in for ArcMap that shows important news for our company. It is actually a toolbar with combobox and refresh button. It loads news from a text file located in our server and as every user has an access to it, this toolbar loads lines from this file. Finally it looks like this:
Here is a part of code
class gc_cmb(object):
"""Implementation for GC_NewsToolbar_addin.combobox (ComboBox)"""
def __init__(self):
file_txt = u'\\\SRV-03\\Projects\\UTILS\\AddIns\\\\news.txt'
list_news = []
with open(file_txt, 'r') as myfile:
list_news=myfile.read().split('\n')
self.value = list_news[0]
self.items = list_news
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW'
self.width = 'WWWWWWWWWWWWWWWWW'
User can see the latest new in a combobox's window here self.value = list_news[0]
. Other news are in a dropdown list.
The refresh button updates this list.
But there one thing I would like to add:
Auto-update - It would be much better if news are refreshng automtically after text file is edited. Looks like writing some kind of timer but it probably can interrupt geoprocessing tools if they are launch.
Any thoughts?