Set mustHaveApp for all window classes

This commit is contained in:
Robin Dunn
2017-01-21 19:07:59 -08:00
parent bd0927fb02
commit a69601c7c4

View File

@@ -230,6 +230,10 @@ def fixWindowClass(klass, hideVirtuals=True, ignoreProtected=True):
"""
Do common tweaks for a window class.
"""
# NOTE: it may be okay to just do this for top-level windows
# TODO: look into that possibility
klass.mustHaveApp()
# The ctor and Create method transfer ownership of the this pointer to the parent
for func in klass.findAll(klass.name) + klass.findAll('Create'):
if isinstance(func, extractors.MethodDef):
@@ -269,6 +273,8 @@ def fixTopLevelWindowClass(klass, hideVirtuals=True, ignoreProtected=True):
"""
Tweaks for TLWs
"""
klass.mustHaveApp()
# TLW tweaks are a little different. We use the function annotation for
# TransferThis instead of the argument annotation.
klass.find(klass.name).findOverload('parent').transfer = True