claudiof
03-25-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
$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
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
