[wingide-users] Project context menu script to create new file
Mike Higgins
mike at higginsmail.com
Sun Nov 5 11:12:44 MST 2006
Thanks to Martin P. for pointing out that the UI already had a command
that did what I wanted. Here is my first script, that
adds a 'New File...' options to the project browser context menu. The
file will be created and added to the project in the directory where you
right-click. I'm so happy (although I must admit I'm easily amused.)
Here is the text, also included as an attachment:
import wingapi
def new_project_file():
""" Create a new file, using the directory of the currently selected
file in the project browser. """
wingapi.gApplication.ExecuteCommand('new-blank-file')
new_project_file.label = "New File..."
new_project_file.contexts = [wingapi.kContextProject()]
Mike Higgins
-------------- next part --------------
import wingapi
def new_project_file():
""" Create a new file, using the directory of the currently selected
file in the project browser. """
wingapi.gApplication.ExecuteCommand('new-blank-file')
new_project_file.label = "New File..."
new_project_file.contexts = [wingapi.kContextProject()]
More information about the wingide-users
mailing list