mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Added WhichWindow function to obtain window object given WindowPtr (as
returned by event routines)
This commit is contained in:
parent
2f21246c96
commit
caf7505edc
1 changed files with 17 additions and 0 deletions
|
|
@ -97,11 +97,28 @@ functions = []
|
|||
methods = []
|
||||
execfile(INPUTFILE)
|
||||
|
||||
# Add a manual routine for converting integer WindowPtr's (as returned by
|
||||
# various event routines) to a WindowObject.
|
||||
whichwin_body = """
|
||||
long ptr;
|
||||
|
||||
if ( !PyArg_ParseTuple(_args, "i", &ptr) )
|
||||
return NULL;
|
||||
return WinObj_WhichWindow((WindowPtr)ptr);
|
||||
"""
|
||||
|
||||
f = ManualGenerator("WhichWindow", whichwin_body)
|
||||
f.docstring = lambda : "Resolve an integer WindowPtr address to a Window object"
|
||||
|
||||
functions.append(f)
|
||||
|
||||
# add the populated lists to the generator groups
|
||||
# (in a different wordl the scan program would generate this)
|
||||
for f in functions: module.add(f)
|
||||
for f in methods: object.add(f)
|
||||
|
||||
|
||||
|
||||
# generate output (open the output file as late as possible)
|
||||
SetOutputFileName(OUTPUTFILE)
|
||||
module.generate()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue