Closed theodox closed 10 years ago
I've added this to mGui.core:
@classmethod
def wrap(cls, control_name, key=None):
def _spoof_create(*args, **kwargs):
return control_name
try:
cache_CMD = cls.CMD
cls.CMD = _spoof_create
key = key or control_name
return cls(key, control_name)
finally:
cls.CMD = cache_CMD
Which makes the idiom part of the base mGui,control
in a couple of places the current code uses this idiom to work with existing controls:
This seems to work, but I'm nervous about it. It won't be thread safe (not a major concern - the gui stuff is thread hell no matter what) and it will need extra work for things like parsing existing menus with submenus....