int intFontStyle;
};
+// From S.O. for vertically text in cells...
+//
+@interface VerticallyAlignedTextFieldCell : NSBrowserCell{ //NSTextFieldCell {
+
+}
+
+@end
+
+@implementation VerticallyAlignedTextFieldCell
+
+- (NSRect)titleRectForBounds:(NSRect)theRect {
+ NSRect titleFrame = [super titleRectForBounds:theRect];
+ NSSize titleSize = [[self attributedStringValue] size];
+ titleFrame.origin.y = theRect.origin.y - .5 + (theRect.size.height - titleSize.height) / 2.0;
+ titleFrame.origin.x += (theRect.size.height - titleSize.height) / 2.0;
+ return titleFrame;
+}
+
+- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+ NSRect titleRect = [self titleRectForBounds:cellFrame];
+ [[self attributedStringValue] drawInRect:titleRect];
+}
+
+@end
// prototypes
void NSClearItems(nsgadget *gadget);
column=[[NSTableColumn alloc] init];
[outline addTableColumn:column];
[outline setOutlineTableColumn:column];
- cell=[[NSBrowserCell alloc] init];
- [cell setLeaf:YES];
- [cell setScrollable:YES];
- [column setDataCell:cell];
+
+// cell=[[NSBrowserCell alloc] init];
+// [cell setLeaf:YES];
+// [cell setScrollable:YES];
+// [column setDataCell:cell];
+
+ cell=[[VerticallyAlignedTextFieldCell alloc] init];
+ [column setDataCell:cell];
+
+
[self setDocumentView:outline];
[outline sizeLastColumnToFit];
+
+
return self;
}
-(void)dealloc{