I am trying to update a menuItem
based on the option chosen in another option box. What I actually tying to do is to get a list of folders in one option box (example: project folder names) and when I choose a specific folder (project) in the option box the folders inside that folder are listed in another option box (example: department folder names like animation, modeling, etc.)
global proc GetProject_Root() {
string $projectname ;
string $dataArray[] ;
string $tempArray[] ;
string $project ;
$i ;
string $disp ;
string $m1 ;
string $m2 ;
$serverSaveDir = ( `internalVar -userPrefDir` + "ProjectRoot.txt" ) ;
$serverId = `fopen $serverSaveDir "r"` ;
int $num = 0 ;
string $serverLine = `fgetword $serverId` ;
while ( size( $serverLine ) > 0 ) {
$dataArray[ size( $dataArray ) ] = $serverLine ;
print ( $serverLine ) ;
if ( $num % 2 == 0 ) {
$tempArray[size($tempArray)] = $serverLine ;
}
// get the next line
$serverLine = `fgetword $serverId` ;
$num++ ;
}
fclose $serverId ;
string $window = `window` ;
columnLayout ;
optionMenu -label "project" -cc "print #1**strong text**" proj ;
for ( $projectname in $tempArray ) {
// print ( $projectname + "\n" ) ;
$m1 = `menuItem -label $projectname` ;
}
optionMenu -label "Episode" -cc "print #1" epi ;
for ($projectname in $tempArray) {
// print ( $projectname + "\n" ) ;
$m2 = `menuItem -label $projectname` ;
}
showWindow $window ;
}