MCPcopy Index your code
hub / github.com/python/cpython / addOpenEventSupport

Function addOpenEventSupport

Lib/idlelib/macosx.py:120–132  ·  view source on GitHub ↗

This ensures that the application will respond to open AppleEvents, which makes is feasible to use IDLE as the default application for python files.

(root, flist)

Source from the content-addressed store, hash-verified

118## Fix the menu and related functions.
119
120def addOpenEventSupport(root, flist):
121 """
122 This ensures that the application will respond to open AppleEvents, which
123 makes is feasible to use IDLE as the default application for python files.
124 """
125 def doOpenFile(*args):
126 for fn in args:
127 flist.open(fn)
128
129 # The command below is a hook in aquatk that is called whenever the app
130 # receives a file open event. The callback can have multiple arguments,
131 # one for every file that should be opened.
132 root.createcommand("::tk::mac::OpenDocument", doOpenFile)
133
134def hideTkConsole(root):
135 try:

Callers 1

setupAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…