theodox / mGui

Python module for cleaner maya GUI layout syntax
MIT License
123 stars 23 forks source link

Another fix for overriding Nested.__exit__ #30

Closed bob-white closed 8 years ago

bob-white commented 8 years ago

29 Has an issue where layouts defined as instance fields would no longer get child controls added to them, this should fix that.

Tweaked the stack walking portion. Instead of trying to deduce the frame where our context is defined, instead we just check all of the frames until we reach the top of the stack.

This does add a lot more checking, but hopefully the results are the same. This solves an issue when a parent context is defined at the instance level instead of the local level.

theodox commented 8 years ago

Try this out and see if it fixes the original issue.

https://github.com/theodox/mGui/tree/stack-hack

bob-white commented 8 years ago

Yep, that does fix it.

theodox commented 8 years ago

I went with the cheap fix from stack-hack, it seems to be working and has a lower frankenstein quotient. Maybe we can add a more elegant solution in future but I'd wait for a use case

bob-white commented 8 years ago

Sounds good.