[some code above labeled that dock be reinitialized if it's already there with some strings]
$CB = `window-t "Channel Box / Tool"[a bunch of buttons under it]
-tlb true -wh 260 1000`;
columnLayout -adj true;
rowColumnLayout -nc 1;
button -e -l "<-" -w 260 -h 32 -c "ToggleMergeToolbar";
columnLayout -adj true;
// create a channel box widget
channelBox -h 600;
setParent..;
setParent..;
showWindow $CB;
global proc ToggleMergeToolbar(){
global string $TestIt;
global string $MergeWndDisplay;
$TestIt = `paneLayout -q -vis MergeWindow`;
if ($TestIt == 0){$MergeWndDisplay = "on";}
paneLayout -e -vis 1 MergeWindow;
button -e -l "->" -c "ToggleMergeToolBar;";
if ($TestIt == 1){$MergeWndDisplay = "off";if (`dockControl -ex CB`){
paneLayout -e -vis 0 MergeWindow;dockControl -e -w 400 CB;}
}
button -e -l "<-" -c "ToggleMergeToolbar;";
}
[MergeWindow]
Replies
You've got
dangling out there by itself when it looks like it should be run if $TestIt == 1 since button -e -l "->" -c "ToggleMergeToolBar;"; is run if $TestIt == 0
Good luck, hope that helps
Currently, I have my script working EXCEPT that it cannot find an object in my script. Apparently, it's looking for the object "MergeWindow" which is a procedure I have stated before it. So I'm not really understanding what I'm missing...
Thank you for the idea though! I might try to mess around with it if I get it working and my replaced button doesn't show.
-Criso
(also: it might be pedantic, and more typing, but personally I'd type out the full names of parameters like -edit rather than -e, -command rather than -c. It makes the code a lot easier to understand IMHO.)
NOTE:
Red code means how the code was originally.
Green code means what the code should be changed to.
(I hope you're not colorblind... If so sorry in advance.)
If none of that helps post up all of your code. It'll be easier to see what's going on that way.
http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/mel/index.html
http://ewertb.soundlinker.com/mel/mel.095.php
You cannot edit a button when you are creating it.
I had done a revamp of everything that I had listed (I realized I posted some incorrect code and proceeded to check things and fix them). Still having an issue, but I'll get to that in a moment. At the time I posted this, I was stressed out beyond all reason so I'm sorry that some of the code seems flaky, I was just not thinking straight at this point in time. That aside...
I would like to keep some of the code confidential, so instead of posting it up, I'll PM it to you guys. It's nothing special, I just would like to keep some of it somewhat private.
Ben,thank you for the suggestions. I'll try to implement them with the original code and see if it works. I used global strings because I have a couple strings that needed to be repeated a few times within the code. So, it was outside of just that toolbar. I've only been coding for about a month, mel script being the first thing I learned and python being the second. I've previously studied a bit of both of those websites, very helpful. I'm not sure how I'm doing after a month of programming...
Haiddasalami Yeah, I realized afterwards that I was being a bit stupid on that portion. I'll PM you.
That would be fun if I was. ;D