acidburn0zzz / flexlib

Automatically exported from code.google.com/p/flexlib
MIT License
2 stars 0 forks source link

SuperTabNavigator.setClosePolicyForChild() doesn't work for the first child #312

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
public class X extends SuperTabNavigator {
 public function X() {
  super();
  //this.addChild( new VBox() );
  //this.setClosePolicyForTab( 0, SuperTab.CLOSE_NEVER );
 }
 public function foo():void {
  this.addChild( new VBox() );
  this.setClosePolicyForTab( 0, SuperTab.CLOSE_NEVER );
  trace( this.tabBar.numChildren );
 }
}
var x:X = new X();
x.foo();
x.foo();

What is the expected output? 
1
2

What do you see instead?
0
2

What version of the product are you using? On what operating system?
Just downloaded newest version and installed for flex 4.

Please provide any additional information below.
Something doesn't get initialized with the first tab until things get displayed 
the first time.

Also: if you uncomment the stuff in the constructor, it'll crash in the 
constructor because tabBar isn't even defined by the constructor.

Original issue reported on code.google.com by seanbcus...@gmail.com on 23 Jun 2010 at 9:32