[wingide-users] WingIDE Menus

support at wingide.com support at wingide.com
Fri Apr 22 16:18:03 EDT 2005

On Fri, 22 Apr 2005, Cristian Codorean wrote:
>    I'm using Wing version 2.0.2-3 and I'm trying to integrate perforce 
> with Wing. I've read the cvs integration script but it's still not clear 
> to me how to add menu items to the IDE or if that is possible right now 
> using the wing api. Anyone played with that and is kind enough to share 
> a small example ? And what about connecting the menu items to the script 
> functions ?

Currently, scripts declare where menu items get added for them.  The
resulting menu items are automatically connected to the script functions.  
See the 'contexts' function attributes that are set in the cvs.py script.  
There is also more info at http://wingware.com/doc/scripting/syntax in the
"GUI Contexts" section.

>    And one more thing. From what I've seen, the set_readonly command 
> only works on the active document. Is there a way of using that command 
> on non active open documents ?

You can traverse the list of all open documents's file names with the
GetAllDocuments() method on the wingapi.gApplication.  Then access the
CAPIEditor for each with OpenDocument() and call SetReadOnly() on them.


Stephan Deibel

Wing IDE for Python
Advancing Software Development


More information about the wingide-users mailing list