

#import "TabMatrixPalette.h"
#import "../UITabActionCell.subproj/UITabActionCell.h"

@implementation  TabMatrixPalette

- finishInstantiate
{
    NXRect              frameRect;
    Matrix             *newMatrix;

    [matrix getFrame:&frameRect];

    newMatrix =
    	[[Matrix allocFromZone:[self zone]]
	    initFrame:&frameRect
	    mode:NX_RADIOMODE
	    prototype:[[UITabActionCell allocFromZone:[self zone]] initTextCell:"Folder Tab"]
	    numRows:1
	    numCols:2];

    [[matrix superview] replaceSubview:matrix with:newMatrix];

    [matrix free];

    matrix = newMatrix;

 // set the background gray of tabMatrix to NX_DKGRAY 
    [matrix setBackgroundGray:NX_DKGRAY];

 // set the autosizing and autoscrolling attributes of the matrix 
    [matrix setAutosizing:NX_WIDTHSIZABLE | NX_HEIGHTSIZABLE];
    [matrix setAutoscroll:YES];

 // size tabMatrix to its cells and display it 
    //[matrix sizeTo:NX_WIDTH(&frameRect):NX_HEIGHT(&frameRect)];
	[matrix sizeToFit];
    [matrix display];    
	
    return self;
}
@end
