• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Weird NSBrowser Behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird NSBrowser Behavior


  • Subject: Weird NSBrowser Behavior
  • From: Bill Bumgarner <email@hidden>
  • Date: Mon, 3 Dec 2001 14:18:31 -0500

http://oz.codefab.com/~bbum/BrowserTest.tgz

The above is a small app project that demonstrates some oddities with NSBrowser that I don't understand. It is an attempt to use an NSPopUpButtonCell to render the column titles. Unfortunately, it doesn't work:

- the title cells are not drawn until the window is resized once.... not sure why

- when drawn, the cells are rendered incorrectly. The icon is rendered too high (with half outside the button) while the text is rendered too low (and cut off).

I forced the title height to 50 pixels and it still doesn't work. The app renders a blue box from the title's frame rect to verify that the rect is correct-- it is, the problem appears to be in NSPopUpButtonCell.

All of the code is enclosed-- it is simple.

Any ideas? I'm hesitant to file a bug report because I am not sure it is actually a bug in Cocoa... much more likely that it is my abuse of the APIs.

thanks,
b.bum

#import "CellTitledBrowser.h"

@implementation CellTitledBrowser
- (void) awakeFromNib
{
NSLog(@"Initializing CellTitledBrowser");

titleCell = [[NSPopUpButtonCell alloc] initTextCell:@"Title"];
[titleCell setControlSize: NSSmallControlSize];
}

- (void)drawTitleOfColumn:(int)column inRect:(NSRect)aRect;
{
[titleCell drawWithFrame: aRect inView: self];

[[NSColor blueColor] set]; NSFrameRect(aRect);
}

- (float)titleHeight;
{
return 50;
//! return [titleCell cellSize].height;
}

@end


  • Prev by Date: quicktime movie inside an existing view?
  • Next by Date: Re: Question
  • Previous by thread: Re: quicktime movie inside an existing view?
  • Next by thread: Re: Weird NSBrowser Behavior
  • Index(es):
    • Date
    • Thread