theodox / mGui

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

tabLayout management sucks #6

Closed theodox closed 8 years ago

theodox commented 10 years ago

Maya's default tabLayout management is pretty nasty: like formLayout it involves a lot of retrospective editing

What's the right way to clean it up?

right now you could do with TabLayout("fred") as tabs: with FormLayout("xxx") as tab1: Button("example") with FormLayout("yyy") as tab2: Button("example") tabs.tabLabels = ((tab1, "XXX"), (tab2, "YYY"))

but it would be nice if you did not have to. Could we:

other ideass?

theodox commented 10 years ago

Current version now uses the key value of the children to auto populate labels when the tablayout context closes

with TabLayout('tabs'): with FormLayout('hello'):

etc

with FormLayout("world"):
    #etc

produces two tabs named 'hello' and 'world'