+- (void)buildMeterWindowWithCharacter:(NSString *)character
+ count:(int)count
+ active:(int)active
+{
+ NSFont *font = [NSFont fontWithName:@"Lucida Grande Bold" size:18];
+ NSDictionary *attr = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
+ NSSize charSize = [character sizeWithAttributes:attr];
+ float cellHeight = ( charSize.height + 4.0 ); // Add 4.0 for shadow
+ float cellWidth = ( (charSize.width) + SW_METER_PAD ); // Add 8.0 for Apple suck
+ float dataWidth = ( cellWidth * count );
+ NSRect dataRect = [self setupWindowWithDataSize:NSMakeSize(dataWidth, cellHeight)];
+ NSEnumerator *cellEnum = nil;
+ id aCell = nil;
+ int activeCount = 0;
+ NSColor *onColor = [NSColor whiteColor];
+ NSColor *offColor = [NSColor colorWithCalibratedWhite:0.0 alpha:0.50];
+ NSMatrix *volMatrix = [[[NSMatrix alloc] initWithFrame:dataRect
+ mode:NSHighlightModeMatrix
+ cellClass:NSClassFromString(@"ITTextFieldCell")
+ numberOfRows:1
+ numberOfColumns:count] autorelease];
+
+ [volMatrix setCellSize:NSMakeSize(cellWidth, cellHeight)];
+ [volMatrix setIntercellSpacing:NSMakeSize(0, 0)];
+
+ cellEnum = [[volMatrix cells] objectEnumerator];
+
+ while ( (aCell = [cellEnum nextObject]) ) {
+ [aCell setEditable:NO];
+ [aCell setSelectable:NO];
+ [aCell setBordered:NO];
+ [aCell setDrawsBackground:NO];
+ [aCell setAlignment:NSCenterTextAlignment];
+ [aCell setFont:font];
+ [aCell setStringValue:character];
+
+ activeCount ++;