Files
gnatstudio/examples/python/project_view.py
Florian Villoing 0a31a0da5b New example inspired by G503-015.
git-svn-id: svn+ssh://svn.eu/Dev/importfromcvs/trunk@101449 936e1b1b-40f2-da11-902a-00137254ae57
2007-05-04 15:36:35 +00:00

19 lines
542 B
Python

## This script changes the label of the project view and set it to the current
## project file path. Upon a project changed, the title is properly updated.
from GPS import *
def update_project_view_title (t):
new_name = Project.root().file().name()
new_short_name = Project.root().name()
view = MDI.get ("Project View")
if view != None:
view.rename (new_name, new_short_name)
t.remove()
def on_project_changed (h):
t = Timeout (100, update_project_view_title)
Hook ("project_changed").add (on_project_changed)