PDA

View Full Version : another bug in treeview control


claudiof
03-25-2009, 05: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
$layout;

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

Buexe
03-26-2009, 12:05 AM
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-26-2009, 12:05 AM
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.