Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

custom window erratic behavior

custom window erratic behavior

dmacedomanu
Observer Observer
444 Views
1 Reply
Message 1 of 2

custom window erratic behavior

dmacedomanu
Observer
Observer

Hello, I searched the forum for an answer but could not find anything.  

 

I'm programming a custom animation UI, I have done this several times, using the code i've always used: 

 

proc crt_animUI()

{

          if(`window -q -exists animUI`)
                 deleteUI animUI;

          window -t "Anim UI"  animUI;

           // my code with tabs, menus, etc, everything works fine

          showWindow animUI;

}

crt_animUI();

 

Everything works perfectly, except when i call back the procedure crt_animUI.  Sometimes it does delete and remake the window, but sometimes it just deletes it but doesn't show it any more.  I can't find any reason why sometimes it works and sometimes it doesn't.  
Any ideas? 

Thanks!

 

0 Likes
445 Views
1 Reply
Reply (1)
Message 2 of 2

dmacedomanu
Observer
Observer

So I took everything else out and I'm only testing the functionality that is not working...
when testing, it works one, maybe two times, but at some point the window will not reappear. 
Any thoughts?

global proc crt_AnimUI()
{
	string  $type = "Biped";
	if(`window -exists animUI`)
	    deleteUI animUI;
	crt_AnimUI_Init($type);
}

proc crt_AnimUI_Init(string $type)
{
    int $winW = 500;
    int $winH = 100;
    window -t "Anim UI" -w $winW -h $winH animUI;
    
    frameLayout -l "Main Buttons" -h 70 -labelAlign "center" -w $winW mainFrame;
    formLayout -w $winW -numberOfDivisions $winW;
    
    optionMenu -l "Character Type:" -cc ("changeCharType") charTypeMenu;
        menuItem -l "Biped";
        menuItem -l "Quadruped";
            
    showWindow animUI; 
    optionMenu -e -value $type charTypeMenu;      
}

proc changeCharType()
{
    string $charType = `optionMenu -q -value charTypeMenu`;
    if(`window -exists animUI`)
	    deleteUI animUI;
    crt_AnimUI_Init($charType);
}
crt_AnimUI();

 

0 Likes