mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 04:50:07 +01:00
Ensure all window classes declare GetClassDefaultAttributes.
Many do not actually have it, but the docs only declare it in wx.Window so we will miss the ones that really do have one unless we let sip know about them.
This commit is contained in:
@@ -229,7 +229,7 @@ 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
|
||||
# NOTE: it may be okay to just do mustHaveApp for top-level windows
|
||||
# TODO: look into that possibility
|
||||
klass.mustHaveApp()
|
||||
|
||||
@@ -261,6 +261,12 @@ def fixWindowClass(klass, hideVirtuals=True, ignoreProtected=True):
|
||||
removeVirtuals(klass)
|
||||
addWindowVirtuals(klass)
|
||||
|
||||
if not klass.findItem('GetClassDefaultAttributes'):
|
||||
klass.addItem(extractors.WigCode("""\
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
"""))
|
||||
|
||||
if not ignoreProtected:
|
||||
for item in klass.allItems():
|
||||
if isinstance(item, extractors.MethodDef) and item.protection == 'protected':
|
||||
|
||||
Reference in New Issue
Block a user