nested tabLayout refresh problem

92 views
Skip to first unread message

Michał Frątczak

unread,
Apr 8, 2014, 2:10:56 PM4/8/14
to python_in...@googlegroups.com
I've got a nested tabLayout that has problems with displaying it's content.
The layouts hierarchy looks like: window -> tabLayout -> paneLayout -> tabLayout -> paneLayout -> textScrollList 
After showing the window, the active tab is empty, and I have to switch to other tab to refresh.
This is a big problem when i want to draw only one outer tab and one inner - there's no way to refresh. 

Here's a demo (pardon MEL, but python does the same):


proc test_tabLayout()
{
        window;
 
        tabLayout;
        for($i=0; $i<5; ++$i)
        {
                paneLayout;
                        tabLayout;
                                for($j=0; $j<5; ++$j)
                                {
                                        paneLayout;
 
                                        $textScrollListUI = `textScrollList`;
 
                                        for($k=0; $k<5; ++$k)
                                        {
                                                string $item = ($i+1)*($j+1)*($k+1);
                                                textScrollList -e -a $item $textScrollListUI;
                                        }
 
                                        setParent..; // to inner tab
                                }
                                setParent..; // to outer pane
                        setParent..; // to outer tab
        }
 
        showWindow;
}
 
test_tabLayout;


Marcus Ottosson

unread,
Apr 8, 2014, 3:06:45 PM4/8/14
to python_in...@googlegroups.com
MEL! Eeek!


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6f527ace-4c0d-4b94-a8b8-86d673728d99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Justin Israel

unread,
Apr 9, 2014, 6:50:00 AM4/9/14
to python_in...@googlegroups.com
Ok, don't ask me why this this is really needed, but obviously there is some kind of refresh issue with the nested tabs, and if you make it switch tabs and back programmatically, then it works. This small snippet at the end of your function fixes it with a hack. Note, the commented parts are only needed if you were only creating one top level tab and needed a dummy to switch to:

proc test_tabLayout()
{
        window;
 
        string $tabs = `tabLayout`;
        
        for($i=0; $i<5; ++$i)
        {
                paneLayout;
                        tabLayout;
                                for($j=0; $j<5; ++$j)
                                {
                                        paneLayout;
 
                                        $textScrollListUI = `textScrollList`;
 
                                        for($k=0; $k<5; ++$k)
                                        {
                                                string $item = ($i+1)*($j+1)*($k+1);
                                                textScrollList -e -a $item $textScrollListUI;
                                        }
 
                                        setParent..; // to inner tab
                                }
                                setParent..; // to outer pane
                        setParent..; // to outer tab
        }
 
        showWindow;

        //string $dummy = `paneLayout`;
        tabLayout -edit -sti 2 $tabs;
        tabLayout -edit -sti 1 $tabs;
        //deleteUI $dummy;
}
 
test_tabLayout;
 
 



f.michal

unread,
Apr 9, 2014, 10:42:16 AM4/9/14
to python_in...@googlegroups.com
Thanks Justin - that works

W dniu 2014-04-09 12:50, Justin Israel pisze:
Reply all
Reply to author
Forward
0 new messages