View Full Version : another bug in treeview control

03 March 2009, 04:57 PM
ok dudes.I am trying to do and share a useful script by using treeview.
but seems treeview is not stable

string $window = `window`;
string $layout = `formLayout`;
string $control = `treeView -parent $layout -numberOfButtons 3 -abr false`;
formLayout -e
-attachForm $control "top" 2
-attachForm $control "left" 2
-attachForm $control "bottom" 2
-attachForm $control "right" 2

showWindow $window;
treeView -edit -addItem "layer 0" "" $control;
treeView -edit -addItem "layer 1" "" $control;

and rename manually "layer 1" to something like "buggGY" in window

treeView -itemIndex "buggGY" -q $control;

/ Error: line 1: Item 'buggGY' was not found in the treeview //

and do this :
$nodes=`treeView -q -children $control`;

you will see there is 2 elements in array but you cannot query if you manually rename it.
// layer 1 buggGY//

if you attempt to add another existing item .it wont allow.

but you can manually rename with one anothr same existing item.

it seems this control is not stable and not working correctly

another bug

$nodes=`treeView -q -children $control`;

seems no problem maybe

but try this

$nodes=`treeView -children -q $control`;

what is it doing ? changing its children to another invisible window ?

(also that would be very useful if any existing control parent could be editable (changable)
but seems no luck

03 March 2009, 11:05 PM
wow, I can`t get this to work either, check out this with claudiof`s code:
string $test[] = `treeView -q -ch $control`;
treeView -q -itemIndex $test[1] $control;
Even this already throws an error in Maya 2009 without renaming anything. Treeview seems like a great contorl, but the basics seem not really solid. Or what is going wrong here?

CGTalk Moderation
03 March 2009, 11:05 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.